|
@@ -4,7 +4,7 @@ import page from '@/config/page'
|
|
|
import store from '@/vendors/vuex'
|
|
|
import { renewalHead } from '@/model/indexRx'
|
|
|
|
|
|
-
|
|
|
+import { clearStorage } from '../utils/auth'
|
|
|
Vue.use(Router)
|
|
|
|
|
|
// 组件实验室
|
|
@@ -217,6 +217,11 @@ router.beforeEach(async (to, from, next) => {
|
|
|
renewalHead(data).toPromise().then(() => {
|
|
|
next()
|
|
|
})
|
|
|
+ .catch((err) => {
|
|
|
+ clearStorage()
|
|
|
+ resetRouter()
|
|
|
+ next(`/login?redirect=${to.path}`);
|
|
|
+ })
|
|
|
} else {
|
|
|
next()
|
|
|
}
|