style(permission.ts): 注释完善
This commit is contained in:
@@ -14,7 +14,7 @@ router.beforeEach(async (to, form, next) => {
|
|||||||
const { user, permission } = useStore()
|
const { user, permission } = useStore()
|
||||||
const hasToken = user.token
|
const hasToken = user.token
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
// 如果登录成功,跳转到首页
|
// 登录成功,跳转到首页
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
@@ -41,7 +41,7 @@ router.beforeEach(async (to, form, next) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* has no token*/
|
// 无 token
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
if (whiteList.indexOf(to.path) !== -1) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user