Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
前端-黄佳鑫
jinfa-platform
Commits
ec22da16
Commit
ec22da16
authored
Sep 24, 2021
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复路由无效
parent
4fc3e47d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
31 deletions
+37
-31
config.ts
config/config.ts
+1
-0
auth.ts
src/utils/auth.ts
+6
-1
tsconfig.json
tsconfig.json
+30
-30
No files found.
config/config.ts
View file @
ec22da16
...
...
@@ -23,6 +23,7 @@ const config: any = {
},
nodeModulesTransform
:
{
type
:
'none'
,
exclude
:
[]
},
routes
,
extraBabelPlugins
:
[
...
...
src/utils/auth.ts
View file @
ec22da16
...
...
@@ -102,6 +102,11 @@ export const removeAuth = () => {
removeRouters
()
}
const
HOME_URL
=
[
'/'
,
'/memberCenter/home'
]
export
const
asyncRouter
=
async
(
routeLists
:
string
[],
routes
:
any
[])
=>
{
for
(
let
i
=
0
;
i
<
routes
.
length
;
i
++
)
{
const
item
=
routes
[
i
]
...
...
@@ -110,7 +115,7 @@ export const asyncRouter = async (routeLists: string[], routes: any[]) => {
}
else
{
// 参与权限校验的页面
// fix: 修复左侧菜单首页无法显示
if
(
item
.
path
&&
!
routeLists
.
includes
(
item
.
path
)
&&
item
.
path
!==
'/memberCenter/home'
)
{
if
(
item
.
path
&&
!
routeLists
.
includes
(
item
.
path
)
&&
!
HOME_URL
.
includes
(
item
.
path
)
)
{
item
.
hideInMenu
=
true
item
.
noAuth
=
true
}
...
...
tsconfig.json
View file @
ec22da16
{
"compilerOptions"
:
{
"experimentalDecorators"
:
true
,
"target"
:
"esnext"
,
"module"
:
"esnext"
,
"moduleResolution"
:
"node"
,
"importHelpers"
:
true
,
"jsx"
:
"react
"
,
"esModuleInterop"
:
true
,
"noImplicitAny"
:
false
,
"sourceMap"
:
true
,
"baseUrl"
:
"./"
,
"paths"
:
{
"@/*"
:
[
"src/*"
],
"@mock/*"
:
[
"mockStatic/*"
],
"@@/*"
:
[
"src/.umi/*"
]
},
"allowSyntheticDefaultImports"
:
true
},
"include"
:
[
"mock/**/*"
,
"src/**/*"
,
"config/**/*"
,
".umirc.ts"
,
"typings.d.ts"
],
"exclude"
:
[
"node_modules/**/*"
]
}
{
"compilerOptions"
:
{
"experimentalDecorators"
:
true
,
"target"
:
"esnext"
,
"module"
:
"esnext"
,
"moduleResolution"
:
"node"
,
"importHelpers"
:
true
,
"jsx"
:
"react
-jsx"
,
"esModuleInterop"
:
true
,
"noImplicitAny"
:
false
,
"sourceMap"
:
true
,
"baseUrl"
:
"./"
,
"paths"
:
{
"@/*"
:
[
"src/*"
],
"@mock/*"
:
[
"mockStatic/*"
],
"@@/*"
:
[
"src/.umi/*"
]
},
"allowSyntheticDefaultImports"
:
true
},
"include"
:
[
"mock/**/*"
,
"src/**/*"
,
"config/**/*"
,
".umirc.ts"
,
"typings.d.ts"
],
"exclude"
:
[
"node_modules/**/*"
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment