Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
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
紫光云
web-project
Commits
0766dde2
Commit
0766dde2
authored
Jul 01, 2024
by
牛虎林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面问题解决
parent
8b2d0f2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
index.ts
src/router/routes/index.ts
+13
-4
No files found.
src/router/routes/index.ts
View file @
0766dde2
...
...
@@ -25,6 +25,7 @@ const routeFilter = (route: any) => {
// 抽出角色
const
{
auth
}
=
meta
||
{};
if
(
!
auth
)
return
false
;
console
.
log
(
"数据查看"
,
route
)
// 进行角色权限判断
return
roleList
.
some
((
role
)
=>
auth
===
role
);
};
...
...
@@ -32,10 +33,18 @@ const routeFilter = (route: any) => {
Object
.
keys
(
modules
).
forEach
((
key
)
=>
{
const
mod
=
(
modules
as
Recordable
)[
key
].
default
||
{};
const
modList
=
Array
.
isArray
(
mod
)
?
[...
mod
]
:
[
mod
];
const
anyRoute
=
filter
(
modList
,
routeFilter
);
if
(
anyRoute
.
length
>
0
)
{
routeModuleList
.
push
(...
anyRoute
);
if
(
localStorage
.
getItem
(
'urlRoles'
)){
const
anyRoute
=
filter
(
modList
,
routeFilter
);
if
(
anyRoute
.
length
>
0
)
{
routeModuleList
.
push
(...
anyRoute
);
}
}
else
{
getList
().
then
((
res
)
=>
{
roleList
=
res
;
localStorage
.
setItem
(
'urlRoles'
,
JSON
.
stringify
(
res
));
window
.
location
.
reload
();
});
}
});
...
...
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