From 05de777eca6ea10792a1900347baea6db799f3d3 Mon Sep 17 00:00:00 2001 From: yan Date: Fri, 20 Feb 2026 16:25:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(AutoPlan):=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E8=B6=8A=E7=95=8C=E6=A3=80=E6=9F=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将条件判断从 index < arr.length 修改为 index <= arr.length-1 - 防止在解析配置数组时发生索引越界错误 - 确保所有可选配置项都能正确解析而不会抛出异常 --- repo/js/AutoPlan/main.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/repo/js/AutoPlan/main.js b/repo/js/AutoPlan/main.js index 0c60c35f7..bcdcb0a09 100644 --- a/repo/js/AutoPlan/main.js +++ b/repo/js/AutoPlan/main.js @@ -254,7 +254,7 @@ async function loadMode(Load, autoOrderSet, runConfig) { let domainRoundNum = arr[index]; // 解析副本轮数 index++ let sundaySelectedValue = "1" - if (index < arr.length) + if (index <= arr.length-1) sundaySelectedValue = arr[index]; // 解析周日|限时选择的值 // 检查秘境名称是否有效 @@ -265,7 +265,7 @@ async function loadMode(Load, autoOrderSet, runConfig) { if (!domainNameTemp) { throw new Error(`${domainName} 输入错误`); } - if (index < arr.length) { + if (index <= arr.length-1) { const domainSelectedValue = parseInt(config.domainOrderMap.get(domainName) + ""); sundaySelectedValue = domainSelectedValue } @@ -306,25 +306,25 @@ async function loadMode(Load, autoOrderSet, runConfig) { index++ autoLeyLineOutcrop.leyLineOutcropType = arr[index] index++ - if (index < arr.length) + if (index <= arr.length-1) autoLeyLineOutcrop.friendshipTeam = arr[index] index++ - if (index < arr.length) + if (index <= arr.length-1) autoLeyLineOutcrop.useFragileResin = arr[index].trim() !== "" index++ - if (index < arr.length) + if (index <= arr.length-1) autoLeyLineOutcrop.useTransientResin = arr[index].trim() !== "" index++ - if (index < arr.length) + if (index <= arr.length-1) autoLeyLineOutcrop.isGoToSynthesizer = arr[index].trim() !== "" index++ - if (index < arr.length) + if (index <= arr.length-1) autoLeyLineOutcrop.useAdventurerHandbook = arr[index].trim() !== "" index++ - if (index < arr.length) + if (index <= arr.length-1) autoLeyLineOutcrop.isNotification = arr[index].trim() !== "" index++ - if (index < arr.length) + if (index <= arr.length-1) autoLeyLineOutcrop.timeout = parseInteger(arr[index]) autoOrder.autoLeyLineOutcrop = autoLeyLineOutcrop // 将地脉信息对象添加到顺序对象中