优化退出登录
This commit is contained in:
parent
503c6f097f
commit
8cb24c17e7
|
@ -203,11 +203,11 @@ export default {
|
||||||
* 注销登录
|
* 注销登录
|
||||||
*/
|
*/
|
||||||
logout() {
|
logout() {
|
||||||
prototype.$storage.set('user_access_token', null);
|
return new Promise((resolve, reject) => {
|
||||||
prototype.$storage.set('userinfo', null);
|
prototype.$storage.set('user_access_token', null);
|
||||||
$store.commit('user/token', "");
|
prototype.$storage.set('userinfo', null);
|
||||||
prototype.$utils.toast('请重新登录').then(() => {
|
$store.commit('user/token', "");
|
||||||
prototype.$utils.toPage('/pages/index/index', {}, 'switch');
|
return resolve();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,11 @@ export default {
|
||||||
this.$utils.toPage(url);
|
this.$utils.toPage(url);
|
||||||
},
|
},
|
||||||
logout() {
|
logout() {
|
||||||
this.$models.user.logout();
|
this.$models.user.logout().then(() => {
|
||||||
|
this.$utils.toast("退出成功").then(() => {
|
||||||
|
this.$utils.toPage("/pages/index/index", {}, "switch");
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue