|
@@ -7,17 +7,21 @@ const customInterceptor = (chain) => {
|
|
|
const requestParams = chain.requestParams
|
|
|
|
|
|
return chain.proceed(requestParams).then(res => {
|
|
|
- // console.log(res,'proceed')
|
|
|
+ // console.log(res.statusCode,'proceed')
|
|
|
// 只要请求成功,不管返回什么状态码,都走这个回调
|
|
|
if (res.statusCode === HTTP_STATUS.NOT_FOUND) {
|
|
|
+ Taro.setStorageSync("token", "");
|
|
|
+ Taro.setStorageSync('userInfor', "");
|
|
|
+ pageToLogin()
|
|
|
+ // TODO 根据自身业务修改
|
|
|
return {
|
|
|
error: [
|
|
|
{
|
|
|
- message:'请求资源不存在,请重试',
|
|
|
+ message:'请求资源不存在,请重新登录',
|
|
|
start: 404
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
} else if (res.statusCode === HTTP_STATUS.SERVER_ERROR) {
|
|
|
return {
|