From ace1dcd0b82b2ebad73fb0527a02a763129d607a Mon Sep 17 00:00:00 2001 From: Orange Date: Wed, 16 Sep 2020 19:26:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=97=B6=E6=9D=83=E9=99=90=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes https://github.com/jumpserver/trello/issues/332 --- src/utils/org.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/org.js b/src/utils/org.js index fcd0b0fba..d484506a7 100644 --- a/src/utils/org.js +++ b/src/utils/org.js @@ -36,13 +36,16 @@ function hasCurrentOrgPermission() { return orgInList } -function changeOrg(orgId) { +async function changeOrg(orgId) { const org = getOrgIdMapper()[orgId] if (!org) { console.debug('Error: org not found') } else { console.debug('Change to org: ', org) } + // 重置Role为空 + await store.dispatch('users/setCurrentRole', null) + store.dispatch('users/setCurrentOrg', org).then(() => { console.log('Set current org to: ', org) if (hasUUID(location.href)) {