Skip to content

动态修改role,会出现路由跳转异常 #3431

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

Closed
4 tasks done
CJL6015 opened this issue Dec 17, 2023 · 1 comment
Closed
4 tasks done

动态修改role,会出现路由跳转异常 #3431

CJL6015 opened this issue Dec 17, 2023 · 1 comment

Comments

@CJL6015
Copy link

CJL6015 commented Dec 17, 2023

⚠️ 重要 ⚠️ 在进一步操作之前,请检查下列选项。如果您忽视此模板或者没有提供关键信息,您的 Issue 将直接被关闭

  • 已阅读 文档.
  • 确保您的代码已是最新或者所报告的 Bug 在最新版本中可以重现. (部分 Bug 可能已经在最近的代码中修复)
  • 已在 Issues 中搜索了相关的关键词
  • 不是 ant design vue 组件库的 Bug

描述 Bug

我尝试实现一个业务需求,从主界面跳转点击按钮进行跳转,点击不同按钮,返回的角色不一样,显示的菜单也不一样。
为了实现这个需求,我将userInfo内的homePath进行了修改,但是homePath默认被固定在tab栏,无法关闭,如果此时回到主界面点击另一个按钮时,则会保留上个tab,但这个tab又不在本次菜单内,导致最终显示404.

复现 Bug

我使用下面的代码进行重新获取userInfo,渲染菜单,会出现问题
userStore.setToken(token); // 重新获取用户信息和菜单 userStore.getUserInfoAction(); refreshMenu();

系统信息

  • 操作系统: win11
  • Node 版本:v18.17.0
  • 包管理器 (npm/yarn/pnpm) 及其版本:pnpm
@anncwb
Copy link
Collaborator

anncwb commented Apr 9, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@anncwb anncwb added the Stale label Apr 9, 2024
@anncwb anncwb closed this as completed Apr 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants