Browse Source

优化异步任务架构

luojunhui 1 tháng trước cách đây
mục cha
commit
ef0edea66f
1 tập tin đã thay đổi với 14 bổ sung0 xóa
  1. 14 0
      ui/src/config/api.ts

+ 14 - 0
ui/src/config/api.ts

@@ -0,0 +1,14 @@
+// API 配置
+export const API_CONFIG = {
+  BASE_URL: import.meta.env.VITE_API_BASE || 'http://192.168.142.66:6060',
+  TIMEOUT: 15000,
+} as const
+
+export const API_ENDPOINTS = {
+  TASKS: '/api/tasks',
+  TASK_DETAIL: (id: number) => `/api/tasks/${id}`,
+  TASK_RETRY: (id: number) => `/api/tasks/${id}/retry`,
+  TASK_CANCEL: (id: number) => `/api/tasks/${id}/cancel`,
+  SAVE_TOKEN: '/api/save_token',
+  RUN_TASK: '/api/run_task',
+} as const