|
|
|
@ -4,6 +4,7 @@ import { useUserStore } from '../stores/user'
@@ -4,6 +4,7 @@ import { useUserStore } from '../stores/user'
|
|
|
|
|
import { usePermissionStore } from '@/stores/permission' |
|
|
|
|
import { useDictStore } from '@/stores/dict' |
|
|
|
|
import { getToken } from '@/utils/auth' |
|
|
|
|
import { pa } from 'element-plus/es/locale/index.mjs' |
|
|
|
|
|
|
|
|
|
export const defaultRoute = [ |
|
|
|
|
{ |
|
|
|
@ -15,6 +16,15 @@ export const defaultRoute = [
@@ -15,6 +16,15 @@ export const defaultRoute = [
|
|
|
|
|
title: '404', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
path: '/login', |
|
|
|
|
name: 'Login', |
|
|
|
|
component: () => import('@/pages/system/login/index.vue'), |
|
|
|
|
meta: { |
|
|
|
|
hidden: true, |
|
|
|
|
title: '登录', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
path: '/file', |
|
|
|
@ -59,14 +69,14 @@ const router = createRouter({
@@ -59,14 +69,14 @@ const router = createRouter({
|
|
|
|
|
const whiteList = ['/login'] |
|
|
|
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => { |
|
|
|
|
// if (!getToken()) {
|
|
|
|
|
// if (whiteList.indexOf(to.path) !== -1) {
|
|
|
|
|
// next()
|
|
|
|
|
// } else {
|
|
|
|
|
// next('/file/document')
|
|
|
|
|
// }
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
if (!getToken()) { |
|
|
|
|
if (whiteList.indexOf(to.path) !== -1) { |
|
|
|
|
next() |
|
|
|
|
} else { |
|
|
|
|
next('/login') |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (to.path === '/OnlineDocument') { |
|
|
|
|
next('/file/document') |
|
|
|
|
return |
|
|
|
|