Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
24c6ad37
authored
2023-03-27 14:19:04 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:权限
1 parent
e6aa69df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
src/permission.js
src/permission.js
View file @
24c6ad3
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-03-2
4 17:28:37
* @LastEditTime: 2023-03-2
7 14:16:28
*/
import
Vue
from
'vue'
import
router
from
"./router"
;
...
...
@@ -24,6 +24,7 @@ router.beforeEach(async (to, from, next) => {
localStorage
.
removeItem
(
"token"
);
next
();
}
else
{
window
.
document
.
documentElement
.
setAttribute
(
"data-theme"
,
'blue'
);
let
code
=
Vue
.
prototype
.
BASE_API
.
CODE
//判断token是否存在
const
hasToken
=
localStorage
.
getItem
(
"token"
);
...
...
@@ -35,6 +36,7 @@ router.beforeEach(async (to, from, next) => {
if
(
hasAddRoute
)
{
next
();
}
else
{
//请求菜单
const
{
result
:
getMenuData
}
=
(
await
getMenuInfo
(
code
))
||
[];
const
accessRoutes
=
await
store
.
dispatch
(
...
...
@@ -54,7 +56,7 @@ router.beforeEach(async (to, from, next) => {
}
else
{
next
();
}
window
.
document
.
documentElement
.
setAttribute
(
"data-theme"
,
'blue'
);
}
}
else
{
if
(
code
==
'BDCSBPT'
)
{
...
...
Please
register
or
sign in
to post a comment