浏览器兑换独立成页面并按斗鱼模式优化导入

新增 /huya/browser-exchange 页面(精英宝典下方),支持导入账号与
执行兑换,客服仅见已分配账号;账号管理页移除该功能。导入弹窗对齐
斗鱼操作台:服务端分页筛选、可搜索标签、无 CK 不展示、导入本页/
一键导入全部/导入选中;新增 /accounts/ids 接口与 workbench
browser_exchange scope。
This commit is contained in:
yml2213
2026-09-05 18:30:29 +08:00
parent 230d6c1918
commit 178eba1eea
11 changed files with 493 additions and 130 deletions
+6 -3
View File
@@ -30,6 +30,7 @@ import type {
HuyaTaskBatchResult,
HuyaTaskItem,
HuyaBrowserExchangeKit,
HuyaWorkbenchScope,
MessageCountResponse,
MessageDeletedResponse,
MessageResponse,
@@ -42,8 +43,10 @@ export const huyaApi = {
taskTypes: () => api.get<Record<string, string>, Record<string, string>>('/huya/task-types'),
listAccounts: (params?: { assigned_only?: boolean; tag?: string; has_cookie?: boolean; include_cookie?: boolean }) =>
api.get<HuyaAccountItem[], HuyaAccountItem[]>('/huya/accounts', { params }),
listAccountsPaged: (params: PageParams & { assigned_only?: boolean; tag?: string; has_cookie?: boolean; include_cookie?: boolean }) =>
listAccountsPaged: (params: PageParams & { assigned_only?: boolean; tag?: string; has_cookie?: boolean; search?: string; include_cookie?: boolean }) =>
api.get<PaginatedResponse<HuyaAccountItem>, PaginatedResponse<HuyaAccountItem>>('/huya/accounts', { params }),
listAccountIds: (params?: { search?: string; tag?: string; has_cookie?: boolean }) =>
api.get<{ account_ids: number[]; total: number }, { account_ids: number[]; total: number }>('/huya/accounts/ids', { params }),
accountsSummary: () => api.get<HuyaAccountSummary, HuyaAccountSummary>('/huya/accounts/summary'),
/** 设备绑定: 账号 ↔ 环境列表 (画像+指纹状态+账号表合并) */
listDeviceBindings: () =>
@@ -119,11 +122,11 @@ 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') =>
listWorkbenchAccounts: (scope: HuyaWorkbenchScope = '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') =>
updateWorkbenchAccounts: (accountIds: number[], scope: HuyaWorkbenchScope = 'elite') =>
api.put<{ account_ids: number[]; success: boolean }, { account_ids: number[]; success: boolean }>(
'/huya/workbench-accounts', { handbook_scope: scope, account_ids: accountIds },
),
+3
View File
@@ -464,6 +464,9 @@ export interface HuyaAccountItem {
updated_at: string | null;
}
/** 工作台账号集合范围: elite=精英宝典 / browser_exchange=浏览器兑换 */
export type HuyaWorkbenchScope = 'elite' | 'browser_exchange';
/** 本机浏览器人工兑换材料 (登录脚本在用户自己的 Chrome/Edge 控制台执行) */
export interface HuyaBrowserExchangeKit {
account_id: number;