refactor(web): update service clients

- services/agentAssets.js: update agent assets service client
- services/api.js: update API service client
- services/employees.js: update employees service client
This commit is contained in:
caoxiaozhu
2026-05-14 02:58:35 +00:00
parent 3c28cab288
commit feacf2765d
3 changed files with 124 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
import { apiRequest } from './api.js'
import { apiRequest, pickSafeHeaderValue } from './api.js'
const AUTH_USER_STORAGE_KEY = 'x-financial-auth-user'
@@ -14,7 +14,11 @@ function readActorName() {
try {
const payload = JSON.parse(raw)
return String(payload?.name || payload?.username || 'system').trim() || 'system'
return (
pickSafeHeaderValue(payload?.name, payload?.username) ||
pickSafeHeaderValue(payload?.username, 'system') ||
'system'
)
} catch {
return 'system'
}