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
d10f939e
Commit
d10f939e
authored
Sep 03, 2021
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复首次进入无法访问首页
parent
1ddfbc6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
BasicLayout.tsx
src/layouts/BasicLayout.tsx
+0
-1
OuterSide.tsx
src/layouts/components/OuterSide.tsx
+2
-1
auth.ts
src/utils/auth.ts
+2
-1
No files found.
src/layouts/BasicLayout.tsx
View file @
d10f939e
...
...
@@ -93,7 +93,6 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const
list
=
routes
.
filter
((
item
:
any
)
=>
pathname
.
indexOf
(
item
.
key
)
>
-
1
)
return
list
[
0
]
}
// const { formatMessage } = useIntl();
const
basicInfo
=
getMenuData
(
props
.
route
.
routes
,
{
locale
:
false
})
const
menuData
=
basicInfo
.
menuData
?
basicInfo
.
menuData
.
filter
(
item
=>
!
item
.
redirect
)
:
[]
...
...
src/layouts/components/OuterSide.tsx
View file @
d10f939e
...
...
@@ -40,6 +40,7 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
if
(
code
&&
code
===
item
.
relationParentCode
)
{
defaultSelectedKeys
=
item
.
relationParentCode
}
!
item
.
hideInMenu
&&
isAuthPath
(
item
.
path
)
&&
subHeadMenus
.
push
({
path
:
item
.
path
,
title
:
item
.
name
,
...
...
@@ -66,7 +67,7 @@ const OuterSider: React.FC<OuterSiderProps> = observer((props) => {
<
ul
className=
{
styles
.
menuBox
}
>
{
siderMenu
.
map
(
item
=>
(
!
item
.
hideInMenu
&&
<
li
key=
{
item
.
key
}
className=
{
defaultSelectedKeys
===
item
.
relationParentCode
?
styles
.
currentItem
:
''
}
>
<
li
key=
{
item
.
key
}
className=
{
defaultSelectedKeys
===
item
.
relationParentCode
?
styles
.
currentItem
:
''
}
>
<
Link
to=
{
item
.
path
}
>
<
CustomIcon
type=
{
item
.
icon
}
style=
{
{
width
:
20
,
height
:
20
}
}
/>
<
label
>
{
item
.
title
}
</
label
>
...
...
src/utils/auth.ts
View file @
d10f939e
...
...
@@ -109,7 +109,8 @@ export const asyncRouter = async (routeLists: string[], routes: any[]) => {
asyncRouter
(
routeLists
,
item
.
routes
)
}
else
{
// 参与权限校验的页面
if
(
item
.
path
&&
!
routeLists
.
includes
(
item
.
path
))
{
// fix: 修复左侧菜单首页无法显示
if
(
item
.
path
&&
!
routeLists
.
includes
(
item
.
path
)
&&
item
.
path
!==
'/memberCenter/home'
)
{
item
.
hideInMenu
=
true
item
.
noAuth
=
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