虎牙人工兑换改用本机浏览器并新增扩展自动注入登录态
移除服务器浏览器方案(容器/Xvfb/noVNC/CDP 会话管理),后端仅下发 兑换材料;新增内置 Chrome/Edge 扩展一键写入 huya.com 登录态, 未安装扩展时回退控制台脚本手动注入,兑换始终由用户手动完成。
This commit is contained in:
@@ -29,6 +29,7 @@ import type {
|
||||
HuyaTaskBatchRequest,
|
||||
HuyaTaskBatchResult,
|
||||
HuyaTaskItem,
|
||||
HuyaBrowserExchangeKit,
|
||||
MessageCountResponse,
|
||||
MessageDeletedResponse,
|
||||
MessageResponse,
|
||||
@@ -142,4 +143,7 @@ export const huyaApi = {
|
||||
api.get<HuyaTaskItem, HuyaTaskItem>(`/huya/tasks/${taskId}`),
|
||||
cleanupOrphans: () =>
|
||||
api.post<{ message: string; cleaned: number; success: boolean }, { message: string; cleaned: number; success: boolean }>('/huya/tasks/cleanup-orphans'),
|
||||
/** 本机浏览器兑换: 获取目标页与登录脚本, 由用户在自己浏览器的控制台执行 */
|
||||
createBrowserExchange: (accountId: number) =>
|
||||
api.post<HuyaBrowserExchangeKit, HuyaBrowserExchangeKit>(`/huya/accounts/${accountId}/browser-exchange`, {}),
|
||||
};
|
||||
|
||||
@@ -445,6 +445,7 @@ export interface HuyaAccountItem {
|
||||
yyuid: string;
|
||||
username: string;
|
||||
has_password: boolean;
|
||||
has_cookie?: boolean;
|
||||
nickname: string;
|
||||
cookie: string;
|
||||
cookie_preview: string;
|
||||
@@ -463,6 +464,15 @@ export interface HuyaAccountItem {
|
||||
updated_at: string | null;
|
||||
}
|
||||
|
||||
/** 本机浏览器人工兑换材料 (登录脚本在用户自己的 Chrome/Edge 控制台执行) */
|
||||
export interface HuyaBrowserExchangeKit {
|
||||
account_id: number;
|
||||
username: string;
|
||||
target_url: string;
|
||||
cookie_string: string;
|
||||
cookie_script: string;
|
||||
}
|
||||
|
||||
/** 账号 ↔ 设备环境绑定 (一号一环境, 后端 data/huya_device_profiles.json + huya_fp_states) */
|
||||
export interface HuyaDeviceBindingItem {
|
||||
account: string;
|
||||
|
||||
Reference in New Issue
Block a user