feat(automation): 持久执行队列与重复充值确认
This commit is contained in:
@@ -1025,6 +1025,7 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
|
||||
taskType: string,
|
||||
accountIds?: number[],
|
||||
extraPayload: Record<string, unknown> = {},
|
||||
rechargeConfirmationToken?: string,
|
||||
) => {
|
||||
const ids = accountIds || selectedIds;
|
||||
if (ids.length === 0) {
|
||||
@@ -1068,7 +1069,40 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
|
||||
handbook_scope: handbook,
|
||||
concurrency: batchConcurrency,
|
||||
payload,
|
||||
recharge_confirmation_token: rechargeConfirmationToken,
|
||||
});
|
||||
if (result.requires_confirmation) {
|
||||
const accountText = (result.account_names || []).join('、');
|
||||
Modal.confirm({
|
||||
title: '重复 API 充值确认',
|
||||
content: (
|
||||
<Space direction="vertical" size={4}>
|
||||
<Text>{result.message}</Text>
|
||||
<Text type="secondary">
|
||||
{accountText ? `账号:${accountText}` : ''}
|
||||
{accountText ? ';' : ''}
|
||||
金额:{result.amount ?? goldAmount} 鱼翅
|
||||
</Text>
|
||||
</Space>
|
||||
),
|
||||
okText: '确认充值',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
const confirmationToken = result.confirmation_token;
|
||||
if (!confirmationToken) {
|
||||
message.error('充值确认令牌缺失,请重新发起');
|
||||
return;
|
||||
}
|
||||
await startTask(
|
||||
taskType,
|
||||
ids,
|
||||
extraPayload,
|
||||
confirmationToken,
|
||||
);
|
||||
},
|
||||
});
|
||||
return null;
|
||||
}
|
||||
// 只有本页面创建的批次才允许主动弹二维码,防止其他工作台/浏览器的任务打扰当前操作。
|
||||
locallyStartedBatchIds.current.add(result.batch_id);
|
||||
if (
|
||||
@@ -3055,6 +3089,20 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
|
||||
</Space>
|
||||
{configFormValues.gold_recharge_channel === 'supplier_api' && (
|
||||
<>
|
||||
<Space style={{ width: '100%', justifyContent: 'space-between' }}>
|
||||
<Text>重复充值确认窗口(分钟,0=关闭)</Text>
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={1440}
|
||||
precision={0}
|
||||
style={{ width: 300 }}
|
||||
value={configFormValues.recharge_duplicate_confirm_minutes}
|
||||
onChange={(value) => setConfigFormValues((prev) => prev ? {
|
||||
...prev,
|
||||
recharge_duplicate_confirm_minutes: Number(value) || 0,
|
||||
} : prev)}
|
||||
/>
|
||||
</Space>
|
||||
{[
|
||||
{ label: '供应商商品 ID', key: 'gold_api_product_id' },
|
||||
{ label: '充值账号模板名(值为斗鱼昵称)', key: 'gold_api_account_template_name' },
|
||||
|
||||
Reference in New Issue
Block a user