登录任务增加代理切换次数设置
- 后端: LoginBatchRequest 增加 max_proxy_retries 字段,默认10,0=无限 - 核心: DouyuLogin 极验验证循环根据 max_proxy_retries 控制重试 - 前端: 筛选栏增加代理切换次数输入框,Tooltip 提示0=无限切换直到成功 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
bc40d334b9
commit
2b8716cf72
@@ -56,8 +56,8 @@ export const accountApi = {
|
||||
};
|
||||
|
||||
export const loginApi = {
|
||||
createBatch: (account_ids: number[], max_geetest_retries?: number, concurrency?: number) =>
|
||||
api.post<any, any>('/login/batch', { account_ids, max_geetest_retries, concurrency }),
|
||||
createBatch: (account_ids: number[], max_geetest_retries?: number, concurrency?: number, max_proxy_retries?: number) =>
|
||||
api.post<any, any>('/login/batch', { account_ids, max_geetest_retries, concurrency, max_proxy_retries }),
|
||||
listTasks: (batch_id?: string) =>
|
||||
api.get<any, any[]>('/login/tasks', { params: batch_id ? { batch_id } : {} }),
|
||||
stop: (batch_id: string) => api.post<any, any>(`/login/stop/${batch_id}`),
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useState, useRef, useMemo, useCallback } from 'react';
|
||||
import {
|
||||
Table, Button, Select, message, Tag, Space, Spin, InputNumber, Tooltip, Popconfirm, theme,
|
||||
} from 'antd';
|
||||
import { PlayCircleOutlined, StopOutlined, FilterOutlined, ThunderboltOutlined, ReloadOutlined, DownOutlined, UpOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import { PlayCircleOutlined, StopOutlined, FilterOutlined, ThunderboltOutlined, ReloadOutlined, DownOutlined, UpOutlined, DeleteOutlined, SwapOutlined } from '@ant-design/icons';
|
||||
import { accountApi, loginApi } from '../api/modules';
|
||||
import { getUser, hasPerm } from '../store/auth';
|
||||
import { formatTime } from '../utils/time';
|
||||
@@ -33,6 +33,7 @@ export default function LoginTasksPage() {
|
||||
const [wsConnected, setWsConnected] = useState(false);
|
||||
const [selectedTags, setSelectedTags] = useState<string[]>([]);
|
||||
const [concurrency, setConcurrency] = useState(3);
|
||||
const [maxProxyRetries, setMaxProxyRetries] = useState(10);
|
||||
const [logVisible, setLogVisible] = useState(true);
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<number[]>([]);
|
||||
const wsRef = useRef<WebSocket | null>(null);
|
||||
@@ -134,7 +135,7 @@ export default function LoginTasksPage() {
|
||||
setLoading(true);
|
||||
setLogs([]);
|
||||
try {
|
||||
const result = await loginApi.createBatch(accountIds, 5, concurrency);
|
||||
const result = await loginApi.createBatch(accountIds, 5, concurrency, maxProxyRetries);
|
||||
setBatchId(result.batch_id);
|
||||
message.success(`已创建登录任务,共 ${result.count} 个账号`);
|
||||
|
||||
@@ -346,6 +347,19 @@ export default function LoginTasksPage() {
|
||||
/>
|
||||
</Space>
|
||||
</Tooltip>
|
||||
<Tooltip title="代理切换次数,0=无限切换直到成功">
|
||||
<Space size={4}>
|
||||
<SwapOutlined style={{ color: token.colorTextSecondary }} />
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={999}
|
||||
value={maxProxyRetries}
|
||||
onChange={(v) => setMaxProxyRetries(v ?? 10)}
|
||||
style={{ width: 55 }}
|
||||
size="small"
|
||||
/>
|
||||
</Space>
|
||||
</Tooltip>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<PlayCircleOutlined />}
|
||||
|
||||
Reference in New Issue
Block a user