Skip to content

Commit

Permalink
fix: system org
Browse files Browse the repository at this point in the history
  • Loading branch information
BaiJiangJie committed Dec 26, 2024
1 parent df26679 commit 5b3b8f7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/utils/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ async function checkLogin({ to, from, next }) {
return await store.dispatch('users/getProfile')
} catch (e) {
Vue.$log.error(e)
// remove currentOrg: System org item
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i)
if (!key.startsWith('jms_current_org_')) {
continue
}
let value = localStorage.getItem(key)
value = JSON.parse(value)
if (!value.is_system) {
continue
}
localStorage.removeItem(key)
}
const status = e.response.status
if (store.getters.currentOrg.autoEnter) {
await store.dispatch('users/setCurrentOrg', store.getters.preOrg)
Expand Down

0 comments on commit 5b3b8f7

Please sign in to comment.