虎牙精英宝典

This commit is contained in:
yml2213
2026-08-31 19:34:59 +08:00
parent d391e2ce3e
commit 955ba45488
16 changed files with 743 additions and 5 deletions
+14 -2
View File
@@ -118,12 +118,24 @@ export const huyaApi = {
updateConfig: (data: Partial<HuyaConfig>) => api.put<HuyaConfig, HuyaConfig>('/huya/config', data),
listGoods: () => api.get<HuyaGoodsItem[], HuyaGoodsItem[]>('/huya/goods'),
listRechargeGoods: () => api.get<HuyaRechargeGoodsItem[], HuyaRechargeGoodsItem[]>('/huya/recharge-goods'),
listWorkbenchAccounts: (scope: 'elite' = 'elite') =>
api.get<{ account_ids: number[]; configured: boolean }, { account_ids: number[]; configured: boolean }>(
'/huya/workbench-accounts', { params: { handbook_scope: scope } },
),
updateWorkbenchAccounts: (accountIds: number[], scope: 'elite' = 'elite') =>
api.put<{ account_ids: number[]; success: boolean }, { account_ids: number[]; success: boolean }>(
'/huya/workbench-accounts', { handbook_scope: scope, account_ids: accountIds },
),
createTasks: (data: HuyaTaskBatchRequest) =>
api.post<HuyaTaskBatchResult, HuyaTaskBatchResult>('/huya/tasks/batch', data),
listTasks: (batchId?: string) =>
listTasks: (batchId?: string, scope?: 'legacy' | 'elite') =>
api.get<HuyaTaskItem[], HuyaTaskItem[]>('/huya/tasks', {
// 列表轮询默认不带 base64 小程序码,避免每次 1MB+ 流量。
params: batchId ? { batch_id: batchId, include_images: false } : { include_images: false },
params: {
...(batchId ? { batch_id: batchId } : {}),
...(scope ? { handbook_scope: scope } : {}),
include_images: false,
},
}),
tasksSummary: () => api.get<TaskSummary, TaskSummary>('/huya/tasks/summary'),
getTask: (taskId: number) =>
+2
View File
@@ -682,6 +682,7 @@ export interface HuyaConfig {
export interface HuyaTaskBatchRequest {
account_ids: number[];
task_type: string;
handbook_scope?: 'legacy' | 'elite';
concurrency?: number;
payload?: Record<string, unknown>;
}
@@ -699,6 +700,7 @@ export interface HuyaTaskItem {
account_uid: string;
account_nickname: string;
task_type: string;
handbook_scope: 'legacy' | 'elite';
status: string;
message: string;
result: Record<string, unknown> | null;