feat(weapp): 新增开发者中心与平台管理入口及功能

- 小程序端新增开发者中心和平台管理页面模块,完善功能入口
- 新增开发者中心页面(概览、我的应用、API Key和工单)
- 新增平台管理页面(管理首页、应用审核、Git权限审核、域名绑定审核和工单处理)
- 复刻PC端/api/app/*相关API接口,基地址使用WEBSOPY_API_BASE_URL
- 增加公共组件StatCard、EntryGrid、CellRow以支持新页面UI
- 修改首页增加开发者中心和平台管理角色入口,仅对对应用户显示
- 用户页面菜单新增开发者中心和平台管理入口条件展示
- 约定开发者身份使用sys_user.is_developer布尔字段,不再依赖角色表
- 更新登录态业务,菜单是否显示基于登录接口返回的isDeveloper/isAdmin字段
- vip-review审核通过流程调整为只调用setUserDeveloper,后台替换角色为developer并置isDeveloper=1
This commit is contained in:
2026-07-22 16:42:15 +08:00
parent ab1b32af68
commit 2ec3383fd0
4 changed files with 37 additions and 17 deletions

View File

@@ -3,11 +3,11 @@
## 核心约定
### 开发者身份的表示方式
- **开发者身份 = `sys_user.is_developer` 布尔位**(数据库列 `is_developer`不是 `sys_user_role` 里的角色记录。
- **开发者身份主校验位 = `sys_user.is_developer` 布尔位**(数据库列 `is_developer`登录态 `MainController.loginByDeveloperSms` 校验它才允许开发者登录。
- 后端仓库:`/Users/gxwebsoft/JAVA/com.gxwebsoft.core`(单 Maven 模块,包名 `com.gxwebsoft` 分包)。
- 标记接口:`PUT /api/system/user/developer/{userId}``UserController.setDeveloper``UserService.markAsDeveloper`),成功后经 `syncMessageProducer` 同步 websopy。
- 读取点:`MainController.loginByDeveloperSms` 校验 `isDeveloper` 才允许开发者登录。
- 前端调用:`@/api/system/user``setUserDeveloper(userId)`
- **vip-review 审核通过流程(用户 2026-07-22 最终确认)**:前端 `handleApprove` 只调 `setUserDeveloper(userId)`(不碰 `sys_user_role`)。后端 `markAsDeveloper` 做两件事:① 把 `sys_user.is_developer``1`;② **替换**用户角色为 `developer`——`roleService.getByRoleCode(roleCode=developer, tenantId=用户租户)` 找到角色 → 删掉该用户现有 `sys_user_role` → 只绑定 developer 这一个角色,**不与原角色并存**(角色替换包 try/catch失败不影响 isDeveloper 落库)。即"升级为开发者 = 单角色 developer + isDeveloper 标记位",不是新增第二个角色。
- 注意:前端 `vip-review` / `vip-upgrade` 等页面的变量名仍残留 `VIP_ROLE_*``pendingVipCount``dealerPrice` 等旧标识符(仅文案改成了「开发者」),后端角色与缓存 key 仍对应这些旧名,重命名需谨慎。
### 后端代码风格com.gxwebsoft.core