|
|
@@ -1,6 +1,7 @@
|
|
|
import axios from 'axios'
|
|
|
import store from '@/store'
|
|
|
import Vue from 'vue'
|
|
|
+import router from '@/router'
|
|
|
import { getAccessToken, removeAll } from '@/utils/auth'
|
|
|
|
|
|
const instance = axios.create({
|
|
|
@@ -62,6 +63,13 @@ instance.interceptors.response.use(
|
|
|
store.commit('USER_LOGOUT')
|
|
|
store.commit('delToken')
|
|
|
removeAll()
|
|
|
+
|
|
|
+ router.replace({
|
|
|
+ path: '/login',
|
|
|
+ query: {
|
|
|
+ redirect: router.currentRoute.fullPath
|
|
|
+ }
|
|
|
+ })
|
|
|
break
|
|
|
case 404:
|
|
|
console.log('404 错误')
|