feat(M08-D): 补后台登录与可撤销会话

This commit is contained in:
Codex
2026-08-10 13:54:03 +08:00
parent 93d83e81b9
commit 05110087d1
21 changed files with 1059 additions and 48 deletions
+22
View File
@@ -31,8 +31,11 @@ for (const pattern of [
'ContentManagementPanel',
'FranchisePanel',
'LogsSystemPanel',
'AdminLoginPanel',
'运营总览',
'savedToken',
'handleAuthenticated',
'handleLogout',
'loadCleaningWorkspace'
]) {
assert.match(app, new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
@@ -234,6 +237,23 @@ const systemRepository = read('backend/src/operations/system-operations-reposito
assert.match(systemRepository, /sanitizeMetadata/);
assert.match(systemRepository, /TENANT_SYSTEM_CONFIG_UPDATED/);
const adminLogin = read('admin/src/components/AdminLoginPanel.vue');
for (const pattern of ['adminPasswordLogin', '租户代码', '安全登录', '连续失败 5 次']) {
assert.match(adminLogin, new RegExp(pattern));
}
const adminAuthRoutes = read('backend/src/routes/admin-auth.ts');
for (const pattern of ['/admin-api/auth/login', '/admin-api/auth/refresh', '/admin-api/auth/me',
'/admin-api/auth/logout', '/admin-api/auth/credentials/:userId']) {
assert.match(adminAuthRoutes, new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
}
const adminAuthRepository = read('backend/src/auth/admin-auth-repository.ts');
assert.match(adminAuthRepository, /ADMIN_LOGIN_SUCCEEDED/);
assert.match(adminAuthRepository, /ADMIN_LOGIN_FAILED/);
assert.match(adminAuthRepository, /ADMIN_REFRESH_REUSED/);
const adminAuthMigration = read('database/migrations/2026081004_m08d_admin_password_auth.up.sql');
assert.match(adminAuthMigration, /qipai_admin_credentials/);
assert.match(adminAuthMigration, /refresh_token_hash/);
const routes = read('backend/src/routes/business-statistics.ts');
assert.match(routes, /'\/app-api\/management\/statistics', '\/admin-api\/statistics'/);
@@ -278,6 +298,8 @@ for (const pattern of [
'.franchise-metrics',
'.system-metrics',
'.audit-filters',
'.login-shell',
'.session-box',
'@media (max-width: 980px)',
'@media (max-width: 560px)'
]) {