|
@@ -26,12 +26,12 @@ function request(options) {
|
|
|
_obj.url = baseUrl + _obj.url;
|
|
|
_obj.method = _obj.method.toUpperCase();
|
|
|
_obj.success = function(res) {
|
|
|
- if (_obj.url.indexOf('checkLogin') > -1) {
|
|
|
+ if (res.data.status == 200) {
|
|
|
resolve(res);
|
|
|
- } else if (res.data.status === '900010' || res.data.status == 900) {
|
|
|
+ } else if (res.data.status === '900010' || (res.data.status == '500' && _obj.url.indexOf('checkLogin') >= 0)) {
|
|
|
setTimeout(function() {
|
|
|
wx.showToast({
|
|
|
- title: '登录已过期,请重新登录',
|
|
|
+ title: '请登录后使用',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
@@ -45,7 +45,13 @@ function request(options) {
|
|
|
mpvue.reLaunch({ url });
|
|
|
}, 1000);
|
|
|
} else {
|
|
|
- resolve(res);
|
|
|
+ setTimeout(function() {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.data.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ }, 10);
|
|
|
}
|
|
|
};
|
|
|
_obj.fail = function(err) {
|