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