虎牙支持先导入账号密码再登录
This commit is contained in:
@@ -5,8 +5,11 @@ import type {
|
||||
HuyaCookieItem,
|
||||
HuyaCookieImportResult,
|
||||
HuyaGoodsItem,
|
||||
HuyaPasswordAccountImportResult,
|
||||
HuyaPasswordLoginBatchResult,
|
||||
HuyaPasswordLoginRequest,
|
||||
HuyaPasswordLoginResult,
|
||||
HuyaPasswordLoginSelectedRequest,
|
||||
HuyaRechargeGoodsItem,
|
||||
HuyaTaskBatchRequest,
|
||||
HuyaTaskBatchResult,
|
||||
@@ -22,8 +25,12 @@ export const huyaApi = {
|
||||
api.get<HuyaAccountItem[], HuyaAccountItem[]>('/huya/accounts', { params }),
|
||||
importCookies: (text: string, tag: string = '') =>
|
||||
api.post<HuyaCookieImportResult, HuyaCookieImportResult>('/huya/accounts/import-cookies', { text, tag }),
|
||||
importPasswordAccounts: (text: string, tag: string = '') =>
|
||||
api.post<HuyaPasswordAccountImportResult, HuyaPasswordAccountImportResult>('/huya/accounts/import-passwords', { text, tag }),
|
||||
passwordLogin: (data: HuyaPasswordLoginRequest) =>
|
||||
api.post<HuyaPasswordLoginResult, HuyaPasswordLoginResult>('/huya/accounts/password-login', data),
|
||||
passwordLoginSelected: (data: HuyaPasswordLoginSelectedRequest) =>
|
||||
api.post<HuyaPasswordLoginBatchResult, HuyaPasswordLoginBatchResult>('/huya/accounts/password-login/selected', data),
|
||||
assign: (id: number, assigned_to: number | null) =>
|
||||
api.put<MessageResponse, MessageResponse>(`/huya/accounts/${id}/assign`, { assigned_to }),
|
||||
batchAssign: (account_ids: number[], assigned_to: number | null) =>
|
||||
|
||||
@@ -116,6 +116,7 @@ export interface HuyaAccountItem {
|
||||
uid: string;
|
||||
yyuid: string;
|
||||
username: string;
|
||||
has_password: boolean;
|
||||
nickname: string;
|
||||
cookie: string;
|
||||
cookie_preview: string;
|
||||
@@ -148,6 +149,28 @@ export interface HuyaPasswordLoginResult extends MessageResponse {
|
||||
sdid: string;
|
||||
}
|
||||
|
||||
export interface HuyaPasswordLoginBatchItem {
|
||||
line: number;
|
||||
username: string;
|
||||
success: boolean;
|
||||
message: string;
|
||||
account?: HuyaAccountItem;
|
||||
sdid?: string;
|
||||
}
|
||||
|
||||
export interface HuyaPasswordLoginBatchResult extends MessageCountResponse {
|
||||
failed: number;
|
||||
results: HuyaPasswordLoginBatchItem[];
|
||||
}
|
||||
|
||||
export interface HuyaPasswordAccountImportResult extends MessageCountResponse {
|
||||
skipped: number;
|
||||
}
|
||||
|
||||
export interface HuyaPasswordLoginSelectedRequest {
|
||||
account_ids: number[];
|
||||
}
|
||||
|
||||
export interface HuyaCookieItem {
|
||||
id: number;
|
||||
account_id: number;
|
||||
|
||||
Reference in New Issue
Block a user