From 94a36bded9af989232eab9100b5a799de88f2597 Mon Sep 17 00:00:00 2001 From: yan Date: Wed, 18 Feb 2026 20:59:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E6=B7=BB=E5=8A=A0=E5=A4=8D?= =?UTF-8?q?=E6=B4=BB=E9=87=8D=E8=AF=95=E6=AC=A1=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在配置文件中添加 retry_count 参数,默认值为 3 - 从设置界面读取重试次数并转换为整数值 - 将硬编码的重试次数 5 替换为配置值 - 在设置界面添加下拉选择框供用户自定义重试次数 - 添加复活重试功能的 UI 输出调用 --- repo/js/AutoPlan/config/config.js | 2 ++ repo/js/AutoPlan/main.js | 5 +++-- repo/js/AutoPlan/settings.json | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/repo/js/AutoPlan/config/config.js b/repo/js/AutoPlan/config/config.js index e3b4c7b93..8680b0775 100644 --- a/repo/js/AutoPlan/config/config.js +++ b/repo/js/AutoPlan/config/config.js @@ -4,6 +4,7 @@ import {ocrPhysical} from "../utils/physical"; const config = { //setting设置放在这个json run: { + retry_count: 3,//复活重试次数 config: '', // load_uid_config: false, loads: [],//加载方式list @@ -176,6 +177,7 @@ async function initConfig() { // config.user.physical.min = physical.min // 初始化uid config.user.uid = await ocrUid() + config.run.retry_count = (settings.retry_count?parseInt(settings.retry_count):config.run.retry_count) const bgi_tools_token = settings.bgi_tools_token || "Authorization= " const list = Array.from(bgi_tools_token.split("=")).map(item => item.trim()); config.bgi_tools.token.name = list[0] diff --git a/repo/js/AutoPlan/main.js b/repo/js/AutoPlan/main.js index df809bb6f..9153a21cf 100644 --- a/repo/js/AutoPlan/main.js +++ b/repo/js/AutoPlan/main.js @@ -88,7 +88,7 @@ async function autoDomain(autoFight) { log.debug(`副本轮数:${domainParam.DomainRoundNum}`) // 复活重试 - for (let i = 0; i < 5; i++) { + for (let i = 0; i < config.run.retry_count; i++) { try { await dispatcher.RunAutoDomainTask(domainParam); // 其他场景不重试 @@ -102,6 +102,7 @@ async function autoDomain(autoFight) { throw e; } } + await outDomainUI() } /** @@ -145,7 +146,7 @@ async function autoLeyLineOutcrop(autoLeyLineOutcrop) { param.isResinExhaustionMode = true; param.openModeCountMin = true; // 复活重试 - for (let i = 0; i < 5; i++) { + for (let i = 0; i < config.run.retry_count; i++) { try { await dispatcher.RunAutoLeyLineOutcropTask(param); // 其他场景不重试 diff --git a/repo/js/AutoPlan/settings.json b/repo/js/AutoPlan/settings.json index 40fde3c7a..4960f6a6e 100644 --- a/repo/js/AutoPlan/settings.json +++ b/repo/js/AutoPlan/settings.json @@ -17,6 +17,17 @@ "label": "自动秘境计划配置\n语法:说明太长 去看文档", "default": "" }, + { + "name": "retry_count", + "type": "select", + "label": "复活重试次数", + "options": [ + "1","2","3", + "4","5","6", + "7","8","9", + ] , + "default": "3" + }, { "type": "separator" }, @@ -39,8 +50,7 @@ "type": "input-text", "label": "bgi_tools推送全部配置api(去看文档)", "default": "http://127.0.0.1:8081/bgi/auto/plan/domain/json/all" - } -, + }, { "name": "bgi_tools_token", "type": "input-text",