fix(n+1): 批量查询替代循环单查
- IsAdminBootstrapRequired: userRepo.GetByID 循环 → GetByIDs 批量 - AssignRoles: roleRepo.GetByID 循环 → GetByIDs 批量 - 在 userRepositoryInterface 补充 GetByIDs 方法签名
This commit is contained in:
43
frontend/admin/scripts/playwright-e2e-scenarios.mjs
Normal file
43
frontend/admin/scripts/playwright-e2e-scenarios.mjs
Normal file
@@ -0,0 +1,43 @@
|
||||
export const BASE_SCENARIO_NAMES = [
|
||||
'public-registration',
|
||||
'email-activation',
|
||||
'password-reset',
|
||||
'login-surface',
|
||||
'auth-workflow',
|
||||
'responsive-login',
|
||||
'desktop-mobile-navigation',
|
||||
'user-management-crud',
|
||||
'user-management-batch',
|
||||
'role-management-crud',
|
||||
'permissions-management-crud',
|
||||
'device-management',
|
||||
'login-logs',
|
||||
'operation-logs',
|
||||
'webhook-management',
|
||||
'import-export',
|
||||
'profile-management',
|
||||
'profile-and-security',
|
||||
'settings',
|
||||
'dashboard-stats',
|
||||
]
|
||||
|
||||
export function parseSelectedScenarioNames(rawScenarioNames = '') {
|
||||
return new Set(
|
||||
String(rawScenarioNames ?? '')
|
||||
.split(',')
|
||||
.map((name) => name.trim())
|
||||
.filter(Boolean),
|
||||
)
|
||||
}
|
||||
|
||||
export function selectScenarioNames({ requestedScenarioNames, expectAdminBootstrap }) {
|
||||
const scenarioNames = expectAdminBootstrap
|
||||
? ['admin-bootstrap', ...BASE_SCENARIO_NAMES]
|
||||
: [...BASE_SCENARIO_NAMES]
|
||||
|
||||
if (!requestedScenarioNames || requestedScenarioNames.size === 0) {
|
||||
return scenarioNames
|
||||
}
|
||||
|
||||
return scenarioNames.filter((name) => name === 'admin-bootstrap' || requestedScenarioNames.has(name))
|
||||
}
|
||||
Reference in New Issue
Block a user