ab1975d3c6
授权项目负责人登录后,若当前项目具备项目成员、中心管理或审计导出读取权限,优先进入对应管理后台页面,避免仍停留在我的工作台。 抽取登录协议为共享内容模块,注册页新增服务条款和隐私政策弹窗,并在注册成功后展示待管理员审核提示。 补充路由、登录页和注册页静态回归测试,覆盖 PM 管理后台默认落点和协议弹窗行为。
65 lines
2.0 KiB
Markdown
65 lines
2.0 KiB
Markdown
# Register Protocol Supplement Implementation Plan
|
|
|
|
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
|
|
|
|
**Goal:** 让注册页的“服务条款”和“隐私政策”链接打开可阅读的协议内容。
|
|
|
|
**Architecture:** 把登录页已有 CTMS 协议文案抽到前端共享模块,登录页与注册页共同引用。注册页只增加弹窗状态与打开/关闭逻辑,不新增后端接口、路由或持久化配置。
|
|
|
|
**Tech Stack:** Vue 3 SFC、Element Plus、Vitest。
|
|
|
|
---
|
|
|
|
### Task 1: 共享协议文案
|
|
|
|
**Files:**
|
|
- Create: `frontend/src/content/authProtocol.ts`
|
|
- Modify: `frontend/src/views/Login.vue`
|
|
- Test: `frontend/src/views/Login.test.ts`
|
|
|
|
**Step 1: Write failing test**
|
|
|
|
验证登录页引用共享模块,不再内联维护 `protocolSections`。
|
|
|
|
**Step 2: Run test to verify it fails**
|
|
|
|
Run: `npm run test:unit -- src/views/Login.test.ts`
|
|
|
|
**Step 3: Write minimal implementation**
|
|
|
|
创建共享协议模块并让登录页导入。
|
|
|
|
**Step 4: Run test to verify it passes**
|
|
|
|
Run: `npm run test:unit -- src/views/Login.test.ts`
|
|
|
|
### Task 2: 注册页协议弹窗
|
|
|
|
**Files:**
|
|
- Modify: `frontend/src/views/Register.vue`
|
|
- Test: `frontend/src/views/Register.test.ts`
|
|
|
|
**Step 1: Write failing test**
|
|
|
|
验证注册页两个协议按钮有 `@click` 行为、弹窗根据当前类型展示服务条款或隐私政策、确认按钮关闭弹窗。
|
|
|
|
**Step 2: Run test to verify it fails**
|
|
|
|
Run: `npm run test:unit -- src/views/Register.test.ts`
|
|
|
|
**Step 3: Write minimal implementation**
|
|
|
|
添加 `protocolDialogVisible`、`activeProtocolType`、`activeProtocolTitle`、`activeProtocolSections`、`openProtocolDialog`、`closeProtocolDialog`,模板新增 `el-dialog`。
|
|
|
|
**Step 4: Run test to verify it passes**
|
|
|
|
Run: `npm run test:unit -- src/views/Register.test.ts`
|
|
|
|
### Task 3: Final verification
|
|
|
|
Run:
|
|
- `npm run test:unit -- src/views/Login.test.ts src/views/Register.test.ts`
|
|
- `npm run type-check`
|
|
|
|
不执行 git commit,遵循用户指令。
|