Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
d82b6972
Commit
d82b6972
authored
Sep 22, 2023
by
左玲玲
😬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1357
parent
c53507cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
app.jsx
src/app.jsx
+7
-2
index.jsx
src/components/TagView/index.jsx
+1
-1
No files found.
src/app.jsx
View file @
d82b6972
...
@@ -152,11 +152,16 @@ export const layout = ({ initialState, setInitialState }) => {
...
@@ -152,11 +152,16 @@ export const layout = ({ initialState, setInitialState }) => {
noFound
:
<
div
>
noFound
</
div
>,
noFound
:
<
div
>
noFound
</
div
>,
// 增加一个 loading 的状态
// 增加一个 loading 的状态
childrenRender
:
(
children
,
props
)
=>
{
childrenRender
:
(
children
,
props
)
=>
{
// if (initialState?.loading) return <PageLoading />;
let
home
,
items
=
initialState
?.
newMenu
?.
userHavePermList
??
[];
if
(
history
.
location
.
pathname
!=
"/welcome"
&&
history
.
location
.
pathname
!=
"/"
)
{
home
=
history
.
location
.
pathname
}
else
{
home
=
items
?.
length
>
0
?
items
[
0
].
path
.
indexOf
(
"/"
)
>
-
1
?
items
[
0
].
path
:
items
[
0
]?.
routes
?.
length
>
0
?
items
[
0
]?.
routes
[
0
]?.
path
:
""
:
""
;
}
return
(
return
(
<>
<>
{
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
?
(
{
initialState
?.
currentUser
&&
location
.
pathname
!==
loginPath
?
(
<
TagView
home=
"/welcome"
>
{
children
}
</
TagView
>
<
TagView
home=
{
home
}
>
{
children
}
</
TagView
>
)
:
(
)
:
(
children
children
)
}
)
}
...
...
src/components/TagView/index.jsx
View file @
d82b6972
...
@@ -34,7 +34,7 @@ const TagView = ({ home }) => {
...
@@ -34,7 +34,7 @@ const TagView = ({ home }) => {
treeForeach
(
menuData
,
(
node
)
=>
{
treeForeach
(
menuData
,
(
node
)
=>
{
allarr
.
push
(
node
);
allarr
.
push
(
node
);
});
});
const
firstTag
=
allarr
.
filter
((
el
)
=>
el
.
path
===
location
?.
hash
?.
replace
(
'#'
,
''
)
)[
0
];
const
firstTag
=
allarr
.
filter
((
el
)
=>
el
.
path
===
home
)[
0
];
if
(
firstTag
)
{
if
(
firstTag
)
{
const
title
=
firstTag
.
name
;
const
title
=
firstTag
.
name
;
const
path
=
firstTag
.
path
;
const
path
=
firstTag
.
path
;
...
...
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