|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
* @Author: ch
|
|
|
|
|
* @Date: 2022-03-17 17:42:32
|
|
|
|
|
* @LastEditors: ch
|
|
|
|
|
* @LastEditTime: 2022-04-20 11:03:08
|
|
|
|
|
* @LastEditTime: 2022-04-20 11:52:43
|
|
|
|
|
* @Description: 项目接口请求统一处理器,返回一个需要token和不需要token的请求封装方法
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
@ -11,8 +11,8 @@ import $store from '@/common/store';
|
|
|
|
|
|
|
|
|
|
const ENV = 'test';
|
|
|
|
|
const BASE_URL = {
|
|
|
|
|
'test' : 'http://k8s-horse-gateway.mashibing.cn',
|
|
|
|
|
// 'test' : '',
|
|
|
|
|
// 'test' : 'http://k8s-horse-gateway.mashibing.cn',
|
|
|
|
|
'test' : '',
|
|
|
|
|
'release' : '',
|
|
|
|
|
'prod' : ''
|
|
|
|
|
};
|
|
|
|
@ -102,7 +102,7 @@ MsbRequestTk.use('request', (option) => {
|
|
|
|
|
page.$Router.replace('/login');
|
|
|
|
|
return Promise.reject({message:'要先登录才能操作哦~'});
|
|
|
|
|
}else{
|
|
|
|
|
option.header = {...option.header, Authorization:$store.state.token};
|
|
|
|
|
option.header = {...option.header, Authorization:token};
|
|
|
|
|
|
|
|
|
|
if(option.header.repeat){
|
|
|
|
|
// 如果当前请求不允许重复调用,则检查重复请求,当前接口有正在请求则不发起请求
|
|
|
|
@ -111,6 +111,7 @@ MsbRequestTk.use('request', (option) => {
|
|
|
|
|
return isRepeatVerify;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(option);
|
|
|
|
|
return option;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|