Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: current org is system and no preorg user logout error #4508

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

fit2bot
Copy link
Contributor

@fit2bot fit2bot commented Dec 12, 2024

fix: current org is system and no preorg user logout error

} else {
localStorage.removeItem(key)
VueCookie.delete('X-JMS-ORG')
}
}

export function setPreOrgLocal(username, org) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the given snippet and found no known issue. It seems fine, with some minor changes like adding curly braces around the "localStorage" lines to keep it consistent in coding style conventions.

Here's what I suggest:

  1. No obvious issues were highlighted.
  2. Ensure that all imports are correct as per version used or consider using a different import statement according to modern JavaScript practices. (Assuming this context is from an older version of Node.js when these statements might be more common.)
  3. For better clarity on global functions and their usage patterns, add comments at appropriate points explaining their purpose, parameters, return value etc., if not already done (especially considering the current code).
  4. If you plan for any future rework or modification to the core logic, make sure to update docstrings where necessary to clearly state how they should interact with other parts of the application or system. Always maintain compatibility across different versions.

@fit2bot fit2bot requested a review from a team December 12, 2024 03:30
} else {
localStorage.removeItem(key)
VueCookie.delete('X-JMS-ORG')
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用户退出时,当前组织为 系统组织(或自动切换的组织),并且设置 currentOrg 为 preOrg(此时 preOrg 为空时),清除本地的 currentOrg,下次登录就不是 system 组织了。否则还是 system。

复现条件:

currentOrg:admin = system
preOrg:admin 没有这个 key

用户点退出。

@ibuler ibuler merged commit 8003173 into dev Dec 12, 2024
5 of 6 checks passed
@ibuler ibuler deleted the pr@dev@fix_orgchanged branch December 12, 2024 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants