|
|
|
@ -152,6 +152,7 @@ service.interceptors.response.use(res => { |
|
|
|
uni.clearStorage(); |
|
|
|
uni.clearStorageSync(); |
|
|
|
uni.showModal({ |
|
|
|
showCancel: false, |
|
|
|
title:'提示', |
|
|
|
content:'您还没有登录!点击确定跳转登录界面以体验服务', |
|
|
|
success(res) { |
|
|
|
@ -170,14 +171,22 @@ service.interceptors.response.use(res => { |
|
|
|
}); |
|
|
|
}else if(res.data.code != 200){ |
|
|
|
//拦截响应,做统一处理
|
|
|
|
if(res.data.code === 500){ |
|
|
|
uni.showToast({ |
|
|
|
title: '网络错误,请稍候重试~', |
|
|
|
icon:"none", |
|
|
|
duration: 2000, |
|
|
|
success() { |
|
|
|
console.log('接口响应错误,'+ res.data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
uni.showToast({ |
|
|
|
title: '网络错误,请稍后再试~', |
|
|
|
title: res.data.msg, |
|
|
|
icon:"none", |
|
|
|
duration: 2000, |
|
|
|
success() { |
|
|
|
console.log('接口请求错误',res.data.msg) |
|
|
|
} |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return res; |
|
|
|
} |
|
|
|
|