This commit is contained in:
@@ -52,6 +52,15 @@ const install = (Vue, vm) => {
|
||||
vm.$u.toast('未连接到服务器')
|
||||
return false;
|
||||
}
|
||||
if(data.code == 401 && req.url.indexOf('/system/user/profile') === -1){
|
||||
// 清除用户信息并返回登录页
|
||||
vm.$u.vuex('vuex_user', {});
|
||||
vm.$u.vuex('vuex_token', '');
|
||||
uni.redirectTo({
|
||||
url: '/pages/sys/login/login'
|
||||
});
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof data === 'object' && !(data instanceof Array)){
|
||||
if (data.token){
|
||||
|
Reference in New Issue
Block a user