submit
This commit is contained in:
parent
b2a0e35609
commit
f7e76d780e
@ -1,13 +1,14 @@
|
|||||||
import {uniFetch} from "@/http/main";
|
import {uniFetch} from "@/http/main";
|
||||||
const fetch=new uniFetch({
|
|
||||||
baseUrl:'https://warehouse.szjixun.cn',
|
|
||||||
interceptors:{
|
|
||||||
//请求拦截器
|
|
||||||
request(config ){
|
|
||||||
|
|
||||||
},
|
const fetch = new uniFetch({
|
||||||
|
baseUrl: 'https://warehouse.szjixun.cn',
|
||||||
|
interceptors: {
|
||||||
|
//请求拦截器
|
||||||
|
request(config) {
|
||||||
|
return config
|
||||||
|
},
|
||||||
//响应拦截器
|
//响应拦截器
|
||||||
response(response){
|
response(response) {
|
||||||
if (response.data?.status === 401) {
|
if (response.data?.status === 401) {
|
||||||
let curPage = getCurrentPages();
|
let curPage = getCurrentPages();
|
||||||
let route = curPage[curPage.length - 1].route; //获取当前页面的路由
|
let route = curPage[curPage.length - 1].route; //获取当前页面的路由
|
||||||
@ -17,6 +18,7 @@ const fetch=new uniFetch({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -141,6 +141,4 @@ class uniFetch {
|
|||||||
return this.request(this.buildRequestOptions(options));
|
return this.request(this.buildRequestOptions(options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export { uniFetch}
|
export { uniFetch}
|
||||||
|
Loading…
Reference in New Issue
Block a user