Commit 70b39688 by 无尘

fix: 修改 vue 文件

parent 5c0c0dad
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2018-10-10 14:44:45
* @LastEditors: 无尘
* @LastEditTime: 2020-07-17 11:14:33
* @LastEditTime: 2020-07-20 15:30:24
*/
// import Vue from 'vue';
import axios from 'axios';
......@@ -71,14 +71,14 @@ axios.interceptors.response.use(
if (window.location.href.indexOf('gic-error') != -1) {
return false;
}
window.location.href = local + '/haoban-3/#/login';
window.location.href = local + '/haoban-4/#/login';
}
/* if (data.data.errorCode == 3) {
Message.error({ message: data.data.message });
window.location.href = local + '/haoban-3/#/login';
} */
if (data.data.errorCode == 10 || data.data.errorCode == 7) {
window.location.href = local + '/haoban-3/#/index';
window.location.href = local + '/haoban-4/#/index';
}
return data;
}
......@@ -90,7 +90,7 @@ axios.interceptors.response.use(
// console.log('请求取消');
}
if (err.response.status == 502) {
window.location.href = local + '/haoban-3/#/login';
window.location.href = local + '/haoban-4/#/login';
Message.error({ message: '服务异常⊙﹏⊙∥' });
}
// Message.error({message: err.response.message});
......@@ -101,7 +101,7 @@ axios.interceptors.response.use(
// window.location.href= local + "/haoban-3/#/login"
// Message.error({message: '权限不足,请联系管理员!'});
} else {
window.location.href = local + '/haoban-3/#/login';
window.location.href = local + '/haoban-4/#/login';
Message.error({ message: '登录失效!' });
}
return Promise.resolve(err);
......@@ -125,7 +125,7 @@ export const getRequest = (url, params) => {
params: params,
headers: {
'Content-type': 'application/x-www-form-urlencoded'
} // "token": token
}
});
};
......@@ -145,7 +145,7 @@ export const postRequest = (url, params) => {
data: qs.stringify(params),
headers: {
'Content-type': 'application/x-www-form-urlencoded'
} //multipart/form-data{"token": token}
}
});
};
......@@ -156,7 +156,7 @@ export const postJsonRequest = (url, params) => {
url: `${local}${url}`,
data: '{}',
params: params,
headers: { 'Content-Type': 'application/json;charset=UTF-8' } //multipart/form-data{"token": token}
headers: { 'Content-Type': 'application/json;charset=UTF-8' }
});
};
......@@ -174,8 +174,6 @@ export const postJson = (url, params) => {
url: `${local}${url}`,
data: params,
params: { requestProject: 'haoban-manage-web' },
// withCredentials: true,
// credentials: 'same-origin',
headers: { 'Content-Type': 'application/json;charset=UTF-8' } //multipart/form-data{"token": token}
});
};
......@@ -191,7 +189,7 @@ export const postForm = (url, params) => {
method: 'post',
url: `${local}${url}`,
data: params,
headers: {} //'content-type': 'application/x-www-form-urlencoded'multipart/form-data{"token": token}
headers: {}
});
};
......@@ -208,12 +206,6 @@ export const postExcel = (url, params) => {
responseType: 'blob',
headers: {
'content-type': 'application/x-www-form-urlencoded'
} //multipart/form-data{"token": token}
/* httpAgent: new http.Agent({
keepAlive: true
}),
httpsAgent: new https.Agent({
keepAlive: true
}) */
}
});
};
/*
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘
* @LastEditTime: 2020-07-20 15:30:44
*/
import axios from 'axios';
import qs from 'qs';
import { Message } from 'element-ui';
......@@ -43,7 +51,7 @@ const request = (opt, params) => {
let resp = res.data;
if (resp.code == notAuthCode) {
window.location.href = `${origin}/damo-system/login`;
window.location.href = `${origin}/haoban-4/#/login`;
return;
}
if (requestConfig.useIntercept && resp.code != succCode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment