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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
config.ts
config/config.ts
+1
-0
auth.ts
src/utils/auth.ts
+6
-1
tsconfig.json
tsconfig.json
+1
-1
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
...
...
@@ -5,7 +5,7 @@
"module"
:
"esnext"
,
"moduleResolution"
:
"node"
,
"importHelpers"
:
true
,
"jsx"
:
"react
"
,
"jsx"
:
"react
-jsx"
,
"esModuleInterop"
:
true
,
"noImplicitAny"
:
false
,
"sourceMap"
:
true
,
...
...
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