perf: 手动切换账号提示“项目不存在或不在成员列表内”的情况

This commit is contained in:
kuaifan 2022-02-10 20:34:13 +08:00
parent ae80939d2e
commit 5324861f16
2 changed files with 7 additions and 3 deletions

View File

@ -578,7 +578,7 @@ export default {
title: '退出登录', title: '退出登录',
content: '你确定要登出系统?', content: '你确定要登出系统?',
onOk: () => { onOk: () => {
this.$store.dispatch("logout") this.$store.dispatch("logout", false)
} }
}); });
return; return;

View File

@ -367,10 +367,14 @@ export default {
* 登出打开登录页面 * 登出打开登录页面
* @param state * @param state
* @param dispatch * @param dispatch
* @param appendFrom
*/ */
logout({state, dispatch}) { logout({state, dispatch}, appendFrom = true) {
dispatch("handleClearCache", {}).then(() => { dispatch("handleClearCache", {}).then(() => {
const from = ["/", "/login"].includes(window.location.pathname) ? "" : encodeURIComponent(window.location.href); let from = ["/", "/login"].includes(window.location.pathname) ? "" : encodeURIComponent(window.location.href);
if (appendFrom === false) {
from = null;
}
$A.goForward({name: 'login', query: from ? {from: from} : {}}, true); $A.goForward({name: 'login', query: from ? {from: from} : {}}, true);
}); });
}, },