增加斗鱼账号检测功能

This commit is contained in:
yml2213
2026-07-09 23:12:39 +08:00
parent 1f16193690
commit cd2d02c86e
16 changed files with 1206 additions and 53 deletions
+13
View File
@@ -0,0 +1,13 @@
import api from './client';
import type { AccountCheckBatch, AccountCheckBatchRequest, MessageResponse } from './types';
export const accountCheckApi = {
start: (data: AccountCheckBatchRequest) =>
api.post<AccountCheckBatch, AccountCheckBatch>('/account-check/batches', data),
getBatch: (batchId: string) =>
api.get<AccountCheckBatch, AccountCheckBatch>(`/account-check/batches/${batchId}`),
stop: (batchId: string) =>
api.post<MessageResponse, MessageResponse>(`/account-check/batches/${batchId}/stop`),
download: (batchId: string) =>
api.get<Blob, Blob>(`/account-check/batches/${batchId}/download`, { responseType: 'blob' }),
};
+1
View File
@@ -7,6 +7,7 @@ interface CreateBatchParams {
max_login_retries?: number;
max_total_time?: number;
api_strategy?: string;
mode?: 'login' | 'check';
}
export const loginApi = {
+1
View File
@@ -1,4 +1,5 @@
export * from './types';
export { accountCheckApi } from './accountCheck';
export { accountApi } from './accounts';
export { appApi } from './app';
export { authApi } from './auth';
+37
View File
@@ -94,6 +94,43 @@ export interface BatchLoginResult {
success: boolean;
}
// ==================== Account Check ====================
export interface AccountCheckBatchRequest {
text: string;
concurrency?: number;
max_login_retries?: number;
max_total_time?: number;
}
export interface AccountCheckItem {
line: number;
username: string;
email: string;
status: string;
message: string;
started_at: string | null;
finished_at: string | null;
}
export interface AccountCheckBatch {
batch_id: string;
status: string;
message: string;
created_by: number;
concurrency: number;
max_login_retries: number;
max_total_time: number;
total: number;
finished_count: number;
running_count: number;
status_counts: Record<string, number>;
created_at: string | null;
started_at: string | null;
finished_at: string | null;
items: AccountCheckItem[];
}
// ==================== Cookie ====================
export interface CookieItem {