forked from AkkomaGang/admin-fe
refine
This commit is contained in:
parent
3063d9c865
commit
021a7009cb
2 changed files with 5 additions and 6 deletions
|
@ -61,7 +61,7 @@
|
|||
├── build // 构建相关
|
||||
├── config // 配置相关
|
||||
├── src // 源代码
|
||||
│ ├── api // 所以请求
|
||||
│ ├── api // 所有请求
|
||||
│ ├── assets // 主题 字体等静态资源
|
||||
│ ├── components // 全局公用组件
|
||||
│ ├── directive // 全局指令
|
||||
|
|
|
@ -7,7 +7,7 @@ export default function _fetch(options) {
|
|||
return new Promise((resolve, reject) => {
|
||||
const instance = axios.create({
|
||||
baseURL: process.env.BASE_API,
|
||||
// timeout: 2000,
|
||||
// timeout: 2000,
|
||||
headers: { 'X-Ivanka-Token': store.getters.token }
|
||||
});
|
||||
instance(options)
|
||||
|
@ -20,15 +20,14 @@ export default function _fetch(options) {
|
|||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
});
|
||||
// 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token
|
||||
// 50014:Token 过期了 50012:其他客户端登录了 50008:非法的token
|
||||
if (res.code === 50008 || res.code === 50014 || res.code === 50012) {
|
||||
Message({
|
||||
message: res.message,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
});
|
||||
// router.push({path: '/'})
|
||||
// TODO
|
||||
// 登出
|
||||
store.dispatch('FedLogOut').then(() => {
|
||||
router.push({ path: '/login' })
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue