新增财务角色与财务报表并完善后台权限

This commit is contained in:
yml2213
2026-09-02 13:58:03 +08:00
parent de63daf1ac
commit bf167d98ed
29 changed files with 1242 additions and 69 deletions
@@ -34,7 +34,7 @@ export type AdminSession = {
permissions: string[]
}
type AdminRole = 'admin' | 'operator' | 'support'
type AdminRole = 'admin' | 'operator' | 'support' | 'finance'
type AdminUserStatus = 'active' | 'disabled'
export async function ensureAdminUsersBootstrapped(): Promise<void> {
@@ -513,6 +513,10 @@ export function normalizeAdminRole(role: unknown): AdminRole {
return 'support'
}
if (normalized === 'finance') {
return 'finance'
}
return 'operator'
}
@@ -539,7 +543,7 @@ function normalizeRoleQuery(role: unknown): string {
const normalized = String(role || '')
.trim()
.toLowerCase()
return ['admin', 'operator', 'support'].includes(normalized) ? normalized : ''
return ['admin', 'operator', 'support', 'finance'].includes(normalized) ? normalized : ''
}
function normalizeStatusQuery(status: unknown): string {