|
@@ -28,23 +28,25 @@ function request(options,hasNoToken) {
|
|
|
_obj.url = baseUrl + _obj.url;
|
|
|
_obj.method = _obj.method.toUpperCase();
|
|
|
_obj.success = function(res) {
|
|
|
+ const isCloseUser = res.data.status === '500'&&(res.data.message == 0||res.data.message == -1)
|
|
|
+ const closeMsg = res.data.message == 0 ? '用户已停用' : '用户已注销'
|
|
|
if (_obj.url.indexOf('checkLogin') > -1) {
|
|
|
- console.log(res.data,'res.data checkLogin')
|
|
|
resolve(res.data);
|
|
|
- } else if (res.data.status === '900010') {
|
|
|
+ } else if (res.data.status === '900010' || isCloseUser) {
|
|
|
setTimeout(function() {
|
|
|
wx.showToast({
|
|
|
- title: '登录已过期,请重新登录',
|
|
|
+ title: isCloseUser ? closeMsg : '登录已过期,请重新登录',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
});
|
|
|
- }, 10);
|
|
|
+ }, 50);
|
|
|
setTimeout(function() {
|
|
|
- const currentRoute = getRoutePath();
|
|
|
- uni.setStorageSync('token','')
|
|
|
- const url = `/pages/login/login?lanuch=${currentRoute.lanuch}&path=` + encodeURIComponent(currentRoute.url);
|
|
|
+ uni.removeStorageSync('token')
|
|
|
+ uni.removeStorageSync('userInfo')
|
|
|
+ uni.removeStorageSync('permCodes')
|
|
|
+ uni.removeStorageSync('userPhoto')
|
|
|
uni.reLaunch({
|
|
|
- url: url
|
|
|
+ url: `/pages/login/login`
|
|
|
})
|
|
|
}, 1000);
|
|
|
} else {
|