|
@@ -1,7 +1,7 @@
|
|
|
import router from './router'
|
|
|
import { useNProgress } from '@/hooks/web/useNProgress'
|
|
|
import { useTitle } from '@/hooks/web/useTitle'
|
|
|
-import { getToken, removeToken } from '@/utils/auth'
|
|
|
+import { getToken, getEnterpriseToken, removeToken } from '@/utils/auth'
|
|
|
|
|
|
const { start, done } = useNProgress()
|
|
|
// 路由不重定向白名单
|
|
@@ -29,7 +29,8 @@ router.beforeEach(async (to, from, next) => {
|
|
|
// loadStart()
|
|
|
if (getToken()) {
|
|
|
if (to.path === '/login') {
|
|
|
- next({ path: '/' })
|
|
|
+ if (getEnterpriseToken()) next({ path: '/enterprise' }) // 已登录企业
|
|
|
+ else next({ path: '/' }) // 已登录个人账号
|
|
|
} else {
|
|
|
const type = localStorage.getItem('loginType')
|
|
|
// 判断企业路由和个人路由,防止互串
|