|
@@ -29,13 +29,7 @@ service.interceptors.request.use(config => {
|
|
|
// 是否需要防止数据重复提交
|
|
|
const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
|
|
|
if (getToken()) {
|
|
|
- const loginPath = isPadDevice() ? 2 : 1;
|
|
|
- console.log('loginPath:',loginPath)
|
|
|
- if(loginPath==1){
|
|
|
config.headers['SX-Access-Token'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
|
|
- }else{
|
|
|
- config.headers['SX-Access-Token'] =getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
|
|
- }
|
|
|
}
|
|
|
// 请求参数加密
|
|
|
if (process.env.VUE_APP_AES_ENCRYPT_ENABLED == 'true') {
|
|
@@ -110,7 +104,7 @@ service.interceptors.response.use(
|
|
|
}
|
|
|
|
|
|
// 判断是否为登录接口
|
|
|
- if (res.config.url.includes('/login' || res.config.url.includes('/loginPad'))) {
|
|
|
+ if (res.config.url.includes('/login')) {
|
|
|
// 跳过登录接口的统一处理,交由业务逻辑处理
|
|
|
if (code !== 200) {
|
|
|
return Promise.reject(res.data); // 返回原始错误数据
|
|
@@ -128,14 +122,7 @@ service.interceptors.response.use(
|
|
|
}).then(() => {
|
|
|
isRelogin.show = false;
|
|
|
store.dispatch('LogOut').then(() => {
|
|
|
- const loginPath = isPadDevice() ? 2 : 1;
|
|
|
- // next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
|
|
- if(loginPath==1){
|
|
|
location.href = '#/login';
|
|
|
- }else{
|
|
|
- location.href = '#/loginPad';
|
|
|
- }
|
|
|
-
|
|
|
});
|
|
|
}).catch(() => {
|
|
|
isRelogin.show = false;
|