mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2026-01-23 08:00:22 +08:00
style: lint
This commit is contained in:
@@ -18,13 +18,16 @@ export function createPermissionGuard(router) {
|
||||
|
||||
/** 没有token */
|
||||
if (!token) {
|
||||
if (WHITE_LIST.includes(to.path)) return true
|
||||
if (WHITE_LIST.includes(to.path))
|
||||
return true
|
||||
return { path: 'login', query: { ...to.query, redirect: to.path } }
|
||||
}
|
||||
|
||||
// 有token的情况
|
||||
if (to.path === '/login') return { path: '/' }
|
||||
if (WHITE_LIST.includes(to.path)) return true
|
||||
if (to.path === '/login')
|
||||
return { path: '/' }
|
||||
if (WHITE_LIST.includes(to.path))
|
||||
return true
|
||||
|
||||
const userStore = useUserStore()
|
||||
const permissionStore = usePermissionStore()
|
||||
@@ -41,7 +44,8 @@ export function createPermissionGuard(router) {
|
||||
}
|
||||
|
||||
const routes = router.getRoutes()
|
||||
if (routes.find((route) => route.name === to.name)) return true
|
||||
if (routes.find(route => route.name === to.name))
|
||||
return true
|
||||
|
||||
// 判断是无权限还是404
|
||||
const { data: hasMenu } = await api.validateMenuPath(to.path)
|
||||
|
||||
Reference in New Issue
Block a user