|
|
@@ -1,5 +1,5 @@
|
|
|
import router from './router'
|
|
|
-import { getAccessToken } from '@/utils/auth'
|
|
|
+import { getAccessToken, removeAll } from '@/utils/auth'
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
const needAuth = to.meta.needAuth
|
|
|
@@ -11,6 +11,7 @@ router.beforeEach((to, from, next) => {
|
|
|
next()
|
|
|
}
|
|
|
} else {
|
|
|
+ removeAll()
|
|
|
if (needAuth) {
|
|
|
next('/login')
|
|
|
} else {
|