feat(auth): use Wayne native role APIs

This commit is contained in:
mac
2026-07-21 17:05:48 +08:00
parent 981e9557fe
commit c324e2ec59
15 changed files with 685 additions and 315 deletions
+7 -2
View File
@@ -6,9 +6,14 @@ export interface UserOption {
}
export const userApi = {
async list(): Promise<UserOption[]> {
async list(params: { businessLineId?: number } = {}): Promise<UserOption[]> {
const token = getToken()
const response = await fetch('/auth/api/v1/users', {
const query = new URLSearchParams()
if (params.businessLineId) {
query.set('business_line_id', String(params.businessLineId))
}
const path = query.toString() ? `/auth/api/v1/users?${query}` : '/auth/api/v1/users'
const response = await fetch(path, {
headers: {
Accept: 'application/json',
...(token ? { Authorization: `Bearer ${token}` } : {}),