71 lines
3.8 KiB
Markdown
71 lines
3.8 KiB
Markdown
## ADDED Requirements
|
|
|
|
### Requirement: Enterprise Account Admin Login Admission
|
|
|
|
The admin login flow SHALL allow enterprise accounts whose `user_type` is `4` to sign in to the admin system when the login API returns a successful response with valid authentication data.
|
|
|
|
The frontend MUST NOT reject admin login solely because `user_type` equals `4`.
|
|
|
|
#### Scenario: Enterprise account is allowed to complete admin login
|
|
|
|
- **GIVEN** 用户使用企业账号凭证登录后台管理系统
|
|
- **AND** 登录接口返回成功状态
|
|
- **AND** 返回数据包含有效 `access_token`
|
|
- **AND** 返回数据中的 `user.user_type` 为 `4`
|
|
- **WHEN** 前端处理登录成功响应
|
|
- **THEN** 前端 MUST 继续执行后台登录成功流程
|
|
- **AND** MUST NOT 弹出“企业账号无法登录后台管理系统,请使用平台/代理账号登录”提示
|
|
|
|
#### Scenario: Enterprise account login still fails when login API itself fails
|
|
|
|
- **GIVEN** 用户使用企业账号凭证登录后台管理系统
|
|
- **AND** 登录接口返回失败状态,或未返回有效 `access_token`
|
|
- **WHEN** 前端处理登录响应
|
|
- **THEN** 前端 MUST 继续按现有登录失败流程处理
|
|
- **AND** MUST NOT 将“允许企业账号登录后台”解释为绕过登录接口失败
|
|
|
|
### Requirement: Enterprise Account Login State Persistence
|
|
|
|
The admin login flow SHALL persist enterprise-account login state using the same token, user, permissions, menus, and buttons handling used for other successful admin logins only when the login response provides usable admin-access data.
|
|
|
|
#### Scenario: Enterprise account saves auth state after successful login with usable admin access data
|
|
|
|
- **GIVEN** 用户使用企业账号成功登录后台管理系统
|
|
- **AND** 登录返回中包含 `access_token`、`refresh_token`、`user`、`permissions`、`menus`、`buttons`
|
|
- **AND** `permissions` 非空
|
|
- **AND** `menus` 非空
|
|
- **WHEN** 前端写入登录态
|
|
- **THEN** 前端 MUST 保存 token
|
|
- **AND** MUST 保存用户信息
|
|
- **AND** MUST 保存权限、菜单和按钮数据
|
|
|
|
#### Scenario: Enterprise account shows no-permission warning without logout follow-up
|
|
|
|
- **GIVEN** 用户使用企业账号成功登录后台管理系统
|
|
- **AND** 登录返回中的 `permissions` 为空,或 `menus` 为空
|
|
- **WHEN** 前端处理登录成功响应
|
|
- **THEN** 前端 MUST 继续显示现有“当前账号暂无任何权限,请联系管理员分配角色和权限”提示
|
|
- **AND** MUST NOT 因为空权限或空菜单回退为企业账号登录拦截
|
|
- **AND** MUST NOT 继续进入后台首页或动态路由注册流程
|
|
- **AND** MUST NOT 因这条无权限提示而调用退出登录接口
|
|
|
|
### Requirement: Enterprise Account Admin Entry Uses Existing Authorization Boundaries
|
|
|
|
Allowing enterprise accounts to sign in to the admin system SHALL NOT by itself grant additional page or API access beyond the existing menu, route-permission, button-permission, and backend authorization boundaries.
|
|
|
|
#### Scenario: Enterprise account enters admin and follows existing route registration flow
|
|
|
|
- **GIVEN** 用户使用企业账号成功登录后台管理系统
|
|
- **AND** 登录返回中的 `permissions` 非空
|
|
- **AND** 登录返回中的 `menus` 非空
|
|
- **WHEN** 前端进入登录后的路由注册和首页跳转流程
|
|
- **THEN** 前端 MUST 继续按现有菜单和动态路由注册逻辑处理
|
|
- **AND** MUST NOT 因 `user_type=4` 在该阶段额外拒绝用户进入后台
|
|
|
|
#### Scenario: Enterprise account page access remains permission-controlled
|
|
|
|
- **GIVEN** 用户已使用企业账号登录后台管理系统
|
|
- **WHEN** 用户尝试访问某个后台页面或触发某个后台操作
|
|
- **THEN** 页面访问和操作可用性 MUST 继续由现有菜单、路由权限、按钮权限和后端接口鉴权决定
|
|
- **AND** 允许登录后台本身 MUST NOT 被解释为默认拥有全部后台页面和操作权限
|