增加了账号管理的分组功能

This commit is contained in:
yml2213
2026-06-22 15:09:51 +08:00
parent 5fa91c1bb4
commit 9af92fc2a9
13 changed files with 437 additions and 55 deletions
+7 -2
View File
@@ -36,11 +36,16 @@ export const userApi = {
};
export const accountApi = {
list: (assigned_only?: boolean) =>
api.get<any, any[]>('/accounts', { params: assigned_only ? { assigned_only: true } : {} }),
list: (params?: { assigned_only?: boolean; tag?: string }) =>
api.get<any, any[]>('/accounts', { params }),
import: (text: string) => api.post<any, any>('/accounts/import', { text }),
assign: (id: number, assigned_to: number | null) =>
api.put<any, any>(`/accounts/${id}/assign`, { assigned_to }),
setTag: (id: number, tag: string) =>
api.put<any, any>(`/accounts/${id}/tag`, { tag }),
batchTag: (account_ids: number[], tag: string) =>
api.put<any, any>('/accounts/batch-tag', { account_ids, tag }),
listTags: () => api.get<any, string[]>('/accounts/tags/list'),
delete: (id: number) => api.delete<any, any>(`/accounts/${id}`),
};