fix(huya): 修复账号页登录队列状态比较导致的前端构建失败
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -273,6 +273,7 @@ export default function HuyaAccountsPage() {
|
|||||||
}, [tags]);
|
}, [tags]);
|
||||||
|
|
||||||
const selectedCount = selectedAllMatching ? total : selectedRowKeys.length;
|
const selectedCount = selectedAllMatching ? total : selectedRowKeys.length;
|
||||||
|
const loginQueueBusy = loginQueuePhase === 'login' || loginQueuePhase === 'wait';
|
||||||
const selectionPayload = useMemo(() => ({
|
const selectionPayload = useMemo(() => ({
|
||||||
account_ids: selectedAllMatching ? [] : selectedRowKeys.map((key) => Number(key)),
|
account_ids: selectedAllMatching ? [] : selectedRowKeys.map((key) => Number(key)),
|
||||||
all_matching: selectedAllMatching,
|
all_matching: selectedAllMatching,
|
||||||
@@ -1892,11 +1893,11 @@ export default function HuyaAccountsPage() {
|
|||||||
title={loginModalTitle}
|
title={loginModalTitle}
|
||||||
open={passwordLoginResultOpen}
|
open={passwordLoginResultOpen}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
if (loginQueuePhase === 'login' || loginQueuePhase === 'wait') return;
|
if (loginQueueBusy) return;
|
||||||
setPasswordLoginResultOpen(false);
|
setPasswordLoginResultOpen(false);
|
||||||
}}
|
}}
|
||||||
footer={[
|
footer={[
|
||||||
(loginQueuePhase === 'login' || loginQueuePhase === 'wait') ? (
|
loginQueueBusy ? (
|
||||||
<Button key="stop" danger onClick={handleStopLoginQueue}>
|
<Button key="stop" danger onClick={handleStopLoginQueue}>
|
||||||
停止队列
|
停止队列
|
||||||
</Button>
|
</Button>
|
||||||
@@ -1906,7 +1907,6 @@ export default function HuyaAccountsPage() {
|
|||||||
<Button
|
<Button
|
||||||
key="retry"
|
key="retry"
|
||||||
icon={<ReloadOutlined />}
|
icon={<ReloadOutlined />}
|
||||||
disabled={loginQueuePhase === 'login' || loginQueuePhase === 'wait'}
|
|
||||||
onClick={() => { void handleRetryFailedLogins(); }}
|
onClick={() => { void handleRetryFailedLogins(); }}
|
||||||
>
|
>
|
||||||
重试失败 ({passwordLoginResults.filter((item) => !item.success).length})
|
重试失败 ({passwordLoginResults.filter((item) => !item.success).length})
|
||||||
@@ -1915,14 +1915,14 @@ export default function HuyaAccountsPage() {
|
|||||||
<Button
|
<Button
|
||||||
key="ok"
|
key="ok"
|
||||||
type="primary"
|
type="primary"
|
||||||
disabled={loginQueuePhase === 'login' || loginQueuePhase === 'wait'}
|
disabled={loginQueueBusy}
|
||||||
onClick={() => setPasswordLoginResultOpen(false)}
|
onClick={() => setPasswordLoginResultOpen(false)}
|
||||||
>
|
>
|
||||||
确定
|
确定
|
||||||
</Button>,
|
</Button>,
|
||||||
].filter(Boolean)}
|
].filter(Boolean)}
|
||||||
maskClosable={loginQueuePhase !== 'login' && loginQueuePhase !== 'wait'}
|
maskClosable={!loginQueueBusy}
|
||||||
closable={loginQueuePhase !== 'login' && loginQueuePhase !== 'wait'}
|
closable={!loginQueueBusy}
|
||||||
width={860}
|
width={860}
|
||||||
>
|
>
|
||||||
<Alert
|
<Alert
|
||||||
@@ -1939,7 +1939,7 @@ export default function HuyaAccountsPage() {
|
|||||||
: '登录说明'
|
: '登录说明'
|
||||||
}
|
}
|
||||||
description={
|
description={
|
||||||
loginQueuePhase === 'login' || loginQueuePhase === 'wait'
|
loginQueueBusy
|
||||||
? `默认单线程,同时只登录一个号;失败最多尝试 ${HUYA_LOGIN_MAX_ATTEMPTS} 次再跳下一个。号与号之间间隔 ${loginIntervalSeconds} 秒。`
|
? `默认单线程,同时只登录一个号;失败最多尝试 ${HUYA_LOGIN_MAX_ATTEMPTS} 次再跳下一个。号与号之间间隔 ${loginIntervalSeconds} 秒。`
|
||||||
: '使用 App 协议登录时,系统已自动识别并通过 safe_auth 乱序滑块;若个别新账号提示“要求扫码验证 (qr_auth)”,则需在手机虎牙 App 上正常登录一次以建立设备信任。失败的账号可一键重试。'
|
: '使用 App 协议登录时,系统已自动识别并通过 safe_auth 乱序滑块;若个别新账号提示“要求扫码验证 (qr_auth)”,则需在手机虎牙 App 上正常登录一次以建立设备信任。失败的账号可一键重试。'
|
||||||
}
|
}
|
||||||
@@ -1951,7 +1951,7 @@ export default function HuyaAccountsPage() {
|
|||||||
min={0}
|
min={0}
|
||||||
max={30}
|
max={30}
|
||||||
value={loginIntervalSeconds}
|
value={loginIntervalSeconds}
|
||||||
disabled={loginQueuePhase === 'login' || loginQueuePhase === 'wait'}
|
disabled={loginQueueBusy}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
const next = Math.min(30, Math.max(0, Number(value ?? HUYA_LOGIN_DEFAULT_INTERVAL)));
|
const next = Math.min(30, Math.max(0, Number(value ?? HUYA_LOGIN_DEFAULT_INTERVAL)));
|
||||||
setLoginIntervalSeconds(next);
|
setLoginIntervalSeconds(next);
|
||||||
@@ -1963,7 +1963,7 @@ export default function HuyaAccountsPage() {
|
|||||||
成功 {passwordLoginResults.filter((item) => item.success).length} · 失败 {passwordLoginResults.filter((item) => !item.success).length}
|
成功 {passwordLoginResults.filter((item) => item.success).length} · 失败 {passwordLoginResults.filter((item) => !item.success).length}
|
||||||
</Text>
|
</Text>
|
||||||
</Space>
|
</Space>
|
||||||
{(loginQueuePhase === 'login' || loginQueuePhase === 'wait') && loginQueueTotal > 0 && (
|
{loginQueueBusy && loginQueueTotal > 0 && (
|
||||||
<Progress
|
<Progress
|
||||||
percent={Math.round(
|
percent={Math.round(
|
||||||
((loginQueuePhase === 'login'
|
((loginQueuePhase === 'login'
|
||||||
|
|||||||
Reference in New Issue
Block a user