优化任务列表性能和本地登录代理

This commit is contained in:
yml2213
2026-08-05 10:03:18 +08:00
parent dff0d7db9e
commit 2fda47c631
13 changed files with 252 additions and 29 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
import api from './client';
import type { BatchLoginResult, LoginTaskItem, MessageDeletedResponse, MessageResponse } from './types';
import type { BatchLoginResult, LoginTaskItem, MessageDeletedResponse, MessageResponse, TaskSummary } from './types';
interface CreateBatchParams {
account_ids: number[];
@@ -15,6 +15,7 @@ export const loginApi = {
api.post<BatchLoginResult, BatchLoginResult>('/login/batch', params),
listTasks: (batch_id?: string) =>
api.get<LoginTaskItem[], LoginTaskItem[]>('/login/tasks', { params: batch_id ? { batch_id } : {} }),
tasksSummary: () => api.get<TaskSummary, TaskSummary>('/login/tasks/summary'),
stop: (batch_id: string) => api.post<MessageResponse, MessageResponse>(`/login/stop/${batch_id}`),
deleteTask: (id: number) => api.delete<MessageResponse, MessageResponse>(`/login/tasks/${id}`),
deleteTasks: (ids: number[]) => api.delete<MessageDeletedResponse, MessageDeletedResponse>(`/login/tasks`, { params: { task_ids: ids.join(',') } }),