This commit is contained in:
ln1778 2024-05-07 11:57:19 +08:00
parent 4c0adafbbf
commit 7e39cb8d9d
1 changed files with 5 additions and 9 deletions

View File

@ -11,7 +11,7 @@ import { MessageBox, Message } from 'element-ui';
// import cancelClass from './cancelToken'
const service = axios.create({
baseURL: window?.VUE_APP_BASE_API?window.VUE_APP_BASE_API:"http://dev-erp-api.xtkj99.com:7890", // api 的 base_url
baseURL: window.VUE_APP_BASE_API?window.VUE_APP_BASE_API:"http://dev-erp-api.xtkj99.com:7890", // api 的 base_url
timeout: 1000 * 60 * 2 // 接口超时
})
@ -165,13 +165,9 @@ service.interceptors.response.use(
type: 'error'
})
} else {
// console.log(Object.getOwnPropertyNames(error));
// console.log(error);
// console.log(error.stack);
// console.log(error.message);
if(error?.response.config){
const copyconfig = JSON.parse(JSON.stringify(error?.response.config))
copyconfig.url = error?.response.config?.url?.replace(copyconfig.baseURL, '')
if(error.response&&error.response.config){
const copyconfig = JSON.parse(JSON.stringify(error.response.config))
copyconfig.url = copyconfig.url.replace(copyconfig.baseURL, '')
if (typeof (copyconfig.data) === undefined || copyconfig.data == {} || copyconfig.data == '' || typeof (copyconfig.data) === 'object') {
copyconfig.data = ''
}