提交
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import axios from 'axios';
|
||||
import QS from 'qs';
|
||||
import { goTologin } from '@/utils/util.js'
|
||||
<<<<<<< HEAD
|
||||
import {showFullScreenLoading,tryHideFullScreenLoading} from './loading'
|
||||
=======
|
||||
import store from '@/store/index';
|
||||
>>>>>>> 542e853 (提交)
|
||||
|
||||
axios.defaults.baseURL = 'https://app.gter.net'
|
||||
// axios.defaults.baseURL = '/index'
|
||||
@@ -32,7 +36,8 @@ axios.interceptors.response.use(
|
||||
switch (error.response.status) {
|
||||
// 401: 未登录
|
||||
case 401:
|
||||
goTologin() // 跳转登录页面
|
||||
// goTologin() // 跳转登录页面
|
||||
store.state.showloginmodal = true
|
||||
break
|
||||
case 403:
|
||||
// router.push('/login')
|
||||
@@ -74,7 +79,11 @@ const $post = (url, params) => {
|
||||
axios.post(url, QS.stringify(params)).then(res => {
|
||||
resolve(res.data);
|
||||
}).catch(err => {
|
||||
reject(err.data)
|
||||
console.log("err", err.data);
|
||||
if (err.data.code == 401) {
|
||||
|
||||
} else reject(err.data)
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user