治理
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import staticRoutes from '@/router/static'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import NProgress from 'nprogress'
|
||||
import { loading } from '@/utils/loading'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@@ -23,7 +23,8 @@ router.beforeEach((to, from, next) => {
|
||||
next()
|
||||
} else {
|
||||
// 获取 token
|
||||
const token = localStorage.getItem('token')
|
||||
const adminInfo = useAdminInfo()
|
||||
const token = adminInfo.getToken()
|
||||
// token 不存在
|
||||
if (token === null || token === '') {
|
||||
ElMessage.error('您还没有登录,请先登录')
|
||||
|
||||
Reference in New Issue
Block a user