|
|
|
@ -68,7 +68,7 @@ http.interceptors.response.use((response) => { |
|
|
|
// 服务端返回的状态码不等于200,则reject()
|
|
|
|
// 服务端返回的状态码不等于200,则reject()
|
|
|
|
if (response.data.code !== 200) { |
|
|
|
if (response.data.code !== 200) { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: response.data.msg, |
|
|
|
title: response.data.msg|| response.data.error_description, |
|
|
|
icon: 'none' |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
}); |
|
|
|
return Promise.reject(response); |
|
|
|
return Promise.reject(response); |
|
|
|
@ -77,7 +77,7 @@ http.interceptors.response.use((response) => { |
|
|
|
}, (response) => { |
|
|
|
}, (response) => { |
|
|
|
/* 对响应错误做点什么 (statusCode !== 200)*/ |
|
|
|
/* 对响应错误做点什么 (statusCode !== 200)*/ |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: response.data.msg, |
|
|
|
title: response.data.msg|| response.data.error_description, |
|
|
|
icon: 'none' |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (response.statusCode == 401) { |
|
|
|
if (response.statusCode == 401) { |
|
|
|
|