|
@@ -38,12 +38,12 @@ export const $http = (url, method, data, json, isloading=true) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 请根据后端规定的状态码判定
|
|
// 请根据后端规定的状态码判定
|
|
|
- if (response.data.code === 300) {//token失效
|
|
|
|
|
|
|
+ if (response?.data?.code === 300) {//token失效
|
|
|
// return response.data = await doRequest(response, url)//动态刷新token,并重新完成request请求
|
|
// return response.data = await doRequest(response, url)//动态刷新token,并重新完成request请求
|
|
|
}else{
|
|
}else{
|
|
|
- if(response.data.code==10021&&response.data.msg){
|
|
|
|
|
|
|
+ if(response?.data?.code==10021&&response?.data?.msg){
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title:response.data.msg,
|
|
|
|
|
|
|
+ title:response?.data?.msg,
|
|
|
icon:'none',
|
|
icon:'none',
|
|
|
duration:1500
|
|
duration:1500
|
|
|
})
|
|
})
|