Merge master
Summary by CodeRabbit
-
新功能
- 新增部门、岗位、数据权限策略等相关后端模型、控制器、服务与数据库迁移,支持部门管理与数据权限策略配置。
- 部门管理菜单及权限点自动生成,支持前端部门管理功能。
- 用户、角色支持数据权限策略的创建与更新,前端展示同步支持。
- 新增全局组件类型声明 MaRemoteSfcLoader。
- 插件配置新增 loginBefore 钩子,可在登录前处理数据。
-
功能优化
- 用户和角色表单支持配置数据权限策略。
- 部门管理页面优化,按钮权限仅筛选类型为 'B' 的子项。
- 登录流程支持插件钩子与语言同步设置。
-
依赖升级
- 前端依赖库版本升级,新增 inquirer 依赖。
-
样式优化
- 多处 el-link 组件 underline 属性由布尔值 false 改为字符串 'never',提升样式一致性。
-
文档
- 修正贡献者链接及部分文档链接。
-
其他
- Docker Compose 项目名规范化为小写 mineadmin。
[!CAUTION]
Review failed
The pull request is closed.
📝 Walkthrough
"""
Walkthrough
本次更新引入了部门与岗位管理的完整数据模型、服务、控制器和数据库迁移,增加了数据权限策略(Policy)及其相关校验和序列化支持。同步完善了角色和用户的权限策略关联、前端依赖升级、菜单权限同步、README修正、Swagger文档和登录流程插件钩子等内容。
Changes
| 文件/分组 | 变更摘要 |
|---|---|
app/Http/Admin/Controller/Permission/DepartmentController.phpapp/Http/Admin/Request/Permission/DepartmentRequest.phpapp/Model/Permission/Department.phpapp/Model/Permission/Position.phpapp/Repository/Permission/DepartmentRepository.phpapp/Service/Permission/DepartmentService.phpapp/Schema/DepartmentSchema.php |
新增部门与岗位管理的控制器、请求校验、模型、仓库、服务及Swagger Schema。 |
app/Model/DataPermission/Policy.phpapp/Model/Enums/DataPermission/PolicyType.phpapp/Schema/PolicySchema.php |
新增数据权限策略模型、类型枚举及其Swagger序列化Schema。 |
app/Model/Permission/Role.phpapp/Model/Permission/User.phpapp/Schema/RoleSchema.phpapp/Schema/UserSchema.phpapp/Repository/Permission/RoleRepository.phpapp/Repository/Permission/UserRepository.phpapp/Service/Permission/RoleService.phpapp/Service/Permission/UserService.phpapp/Http/Admin/Request/Permission/RoleRequest.phpapp/Http/Admin/Request/Permission/UserRequest.php |
角色与用户模型、服务、请求校验、仓库、Schema等增加policy关联、校验与序列化,支持数据权限策略。 |
app/Service/Permission/MenuService.phpweb/src/modules/base/views/permission/menu/menu-form.vue |
菜单服务与前端表单同步优化按钮权限的增删改逻辑,修正按钮权限筛选。 |
databases/migrations/2025_02_24_195620_create_department_tables.php |
新增部门、岗位、用户-部门、用户-岗位、部门负责人、数据权限策略等6张表的数据库迁移。 |
databases/seeders/user_dept_20250310.php |
新增部门权限相关菜单数据的Seeder。 |
app/Http/Common/Swagger/Server.php |
Swagger文档外部链接URL修正。 |
app/Service/AttachmentService.php |
上传文件参数类型由UploadedFile改为UploadedFileInterface,提升兼容性。 |
docker-compose.yml |
项目名由"MineAdmin"小写为"mineadmin"。 |
README.mdREADME-en.md |
修正贡献者链接URL。 |
web/package.json |
升级@mineadmin/pro-table、@mineadmin/search、element-plus等依赖,新增inquirer依赖,锁定vue-i18n版本。 |
web/src/components/ma-dialog/index.vueweb/src/plugins/mine-admin/app-store/views/notice.vueweb/src/modules/base/views/log/userLoginLogData/UserLoginLogColumn.tsx |
前端el-link组件underline属性由false改为'never',部分刷新操作await化。 |
web/src/store/modules/useUserStore.tsweb/types/global.d.ts |
用户登录流程支持插件钩子loginBefore,登录参数类型扩展,应用设置时同步语言。 |
web/types/components.d.ts |
新增MaRemoteSfcLoader全局组件类型声明。 |
Sequence Diagram(s)
sequenceDiagram
participant 用户
participant Controller
participant Service
participant Repository
participant Model
用户->>Controller: 提交部门相关请求
Controller->>Service: 调用业务方法
Service->>Repository: 查询/操作部门数据
Repository->>Model: 读写Department/Position等表
Model-->>Repository: 返回数据
Repository-->>Service: 返回结果
Service-->>Controller: 返回处理结果
Controller-->>用户: 返回API响应
sequenceDiagram
participant 用户
participant Controller
participant Service
participant Model
participant PolicyModel
用户->>Controller: 创建/更新角色或用户(含policy)
Controller->>Service: create/updateById(data)
Service->>Model: 创建/更新实体
Service->>PolicyModel: 创建/更新policy关联
PolicyModel-->>Service: 返回policy结果
Service-->>Controller: 返回实体结果
Controller-->>用户: 返回API响应
Possibly related PRs
-
mineadmin/MineAdmin#640: 同样修改了
AttachmentService的上传参数类型,直接相关。 - mineadmin/MineAdmin#626: 修正README贡献者链接,与本PR内容直接相关。
- mineadmin/MineAdmin#627: 优化菜单按钮权限同步,与本次菜单服务和前端表单的按钮权限处理改动直接相关。
Suggested labels
enhancement, size:L
Suggested reviewers
- kanyxmo
- People-Sea
- develop-chen
Poem
兔子挖洞忙,部门岗位新登场,
数据权限策略强,角色用户皆安康。
前后端齐升级,菜单权限细又长,
代码如田园,春风吹又香。
(兔兔比心 🐰💻🌱) """
📜 Recent review details
Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 420456c2acfbe840808455061d5e0644b46f01ae and dcb182677dfd7981d61e4ece3f10416da56573b0.
📒 Files selected for processing (15)
-
app/Model/Permission/Department.php(1 hunks) -
app/Schema/PolicySchema.php(1 hunks) -
app/Service/Permission/RoleService.php(2 hunks) -
app/Service/Permission/UserService.php(2 hunks) -
databases/seeders/user_dept_20250310.php(1 hunks) -
web/src/modules/base/api/department.ts(1 hunks) -
web/src/modules/base/locales/zh_CN[简体中文].yaml(2 hunks) -
web/src/modules/base/views/permission/department/data/getFormItems.tsx(1 hunks) -
web/src/modules/base/views/permission/department/data/getSearchItems.tsx(1 hunks) -
web/src/modules/base/views/permission/department/data/getTableColumns.tsx(1 hunks) -
web/src/modules/base/views/permission/department/form.vue(1 hunks) -
web/src/modules/base/views/permission/department/index.vue(1 hunks) -
web/src/modules/base/views/permission/department/setLeader.vue(1 hunks) -
web/src/modules/base/views/permission/menu/index.vue(1 hunks) -
web/types/components.d.ts(2 hunks)
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Explain this complex logic. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai explain this code block. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and explain its main purpose. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaiorPR titleanywhere in the PR title to generate the title automatically.
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.