feat(admin): 密码校验统一与后台 API/设置增强
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
lotterLaravel E2E / e2e-api (push) Has been cancelled

- 管理端账号/代理/站点等密码最短长度统一为 6 位
- LotterySettings、审计日志展示、币种与报表接口等小修复
- 补充设置批量更新、注单、校验错误等相关测试
This commit is contained in:
2026-06-26 14:39:22 +08:00
parent 8d5ff0a7ae
commit 3f04b4ebe3
28 changed files with 283 additions and 69 deletions

View File

@@ -30,9 +30,10 @@ test('audit log presenter maps business action and entity target', function ():
expect($payload['operator_label'])->toBe('管理员 #1')
->and($payload['operator_subtitle'])->toBeNull()
->and($payload['module_label'])->toBe('代理')
->and($payload['module_label'])->toBe('代理管理')
->and($payload['action_label'])->toBe('同步代理角色权限')
->and($payload['target_label'])->toBe('角色 #5');
->and($payload['target_label'])->toBe('角色 #5')
->and($payload['summary_label'])->toBe('代理管理 · 同步代理角色权限(角色 #5');
});
test('audit log presenter uses admin api resource name for middleware style rows', function (): void {
@@ -55,7 +56,8 @@ test('audit log presenter uses admin api resource name for middleware style rows
$payload = AuditLogApiPresenter::row($row, $resourceNames);
expect($payload['action_label'])->toBe($resourceName)
->and($payload['target_label'])->toBe($resourceName.' #5');
->and($payload['target_label'])->toBe('代理角色 #5')
->and($payload['summary_label'])->toBe('代理管理 · '.$resourceName.'(代理角色 #5');
});
test('agent role permission sync records one business audit and skips middleware duplicate', function (): void {
@@ -133,7 +135,8 @@ test('audit log index returns chinese display labels', function (): void {
->assertJsonPath('code', ErrorCode::Success->value)
->assertJsonPath('data.items.0.operator_label', '超管甲')
->assertJsonPath('data.items.0.operator_subtitle', '管理员 #'.$admin->id)
->assertJsonPath('data.items.0.module_label', '代理')
->assertJsonPath('data.items.0.module_label', '代理管理')
->assertJsonPath('data.items.0.action_label', '同步代理角色权限')
->assertJsonPath('data.items.0.target_label', '角色 #9');
->assertJsonPath('data.items.0.target_label', '角色 #9')
->assertJsonPath('data.items.0.summary_label', '代理管理 · 同步代理角色权限(角色 #9');
});