-
Notifications
You must be signed in to change notification settings - Fork 235
refactor: permission-fe #893
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
base: develop
Are you sure you want to change the base?
Conversation
…to check permission
|
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors front-end permission handling to use roleCode-based access rules, dynamically registers/unregisters routes at runtime, and adjusts router initialization and 404 handling.
- Introduces dynamic add/remove of routes using Vue Router’s remove functions to support restore on logout.
- Adds roleCode-based filtering for front-end permissions with an optional strict mode toggle.
- Updates router initialization to start with default routes only and adds a proper 404 catch-all component.
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/route/constant.ts | Adds typed 404 route with a catch-all path and component. |
| src/store/modules/user.ts | Simplifies roles and removes persist-time route init hook (handled in guard now). |
| src/store/modules/permission.ts | Registers routes dynamically and provides a robust restore mechanism using remove functions. |
| src/store/modules/permission-fe.ts | Rewrites FE permission filtering based on roleCode and dynamic route registration/restoration. |
| src/router/modules/homepage.ts | Moves root redirect into homepage module. |
| src/router/index.ts | Initializes router with default routes only and exposes whitelist paths. |
| src/permission.ts | Updates navigation guard to build routes once per session and use new whitelist/restore logic. |
| src/layouts/components/MenuContent.vue | Tightens menu filter to require a title and improves default prop typing. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
permission-fe用例roleCode权限处理restore已删除的路由roleCode判断规则📝 更新日志
fix!: 前端权限控制 移除路由
name作为roleCode本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单