feat: add business line permissions and Wayne namespace mapping

This commit is contained in:
mac
2026-07-17 15:02:18 +08:00
parent e1d755b2df
commit d264924d1e
23 changed files with 1343 additions and 81 deletions
+23
View File
@@ -0,0 +1,23 @@
import { getToken } from '@/utils/auth'
export interface UserOption {
uid: number
username: string
}
export const userApi = {
async list(): Promise<UserOption[]> {
const token = getToken()
const response = await fetch('/auth/api/v1/users', {
headers: {
Accept: 'application/json',
...(token ? { Authorization: `Bearer ${token}` } : {}),
},
})
const data = await response.json().catch(() => ({}))
if (!response.ok) {
throw new Error(data.error || `HTTP ${response.status}`)
}
return Array.isArray(data.items) ? data.items : []
},
}