优化退出登录

This commit is contained in:
TOP糯米 2023-04-01 21:52:19 +08:00
parent 503c6f097f
commit 8cb24c17e7
2 changed files with 10 additions and 6 deletions

View File

@ -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();
});
}
}

View File

@ -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");
});
});
},
},
};