单点修改1
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import axios from 'axios'
|
||||
import { Message, MessageBox } from 'element-ui'
|
||||
import router from '../router'
|
||||
import store from '../store'
|
||||
import { getToken } from '@/utils/auth'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
baseURL: process.env.BASE_API, // api 的 base_url
|
||||
timeout: 20000 // 请求超时时间
|
||||
timeout: 200000 // 请求超时时间
|
||||
})
|
||||
|
||||
// request拦截器
|
||||
@@ -41,7 +42,13 @@ service.interceptors.response.use(
|
||||
// sessionStorage.clear()
|
||||
// localStorage.clear()
|
||||
localStorage.removeItem('AJReportToken')
|
||||
window.location.href = "/";
|
||||
router.push({
|
||||
path: '/login',
|
||||
query: {
|
||||
redirect: location.hash.substring(1)
|
||||
}
|
||||
})
|
||||
// window.location.href = "/index?redirect=" + location.hash.substring(1);
|
||||
})
|
||||
}
|
||||
else if (res.code !== '200') {
|
||||
|
||||
Reference in New Issue
Block a user