From d96eea77778e5577890b46f4cbc401985525b87b Mon Sep 17 00:00:00 2001 From: yan Date: Sun, 8 Feb 2026 15:18:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E8=A7=A3=E5=86=B3=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=AF=86=E9=92=A5=E9=AA=8C=E8=AF=81=E5=92=8C=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=88=97=E8=A1=A8=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加了配置密钥验证逻辑,确保密钥匹配 - 实现了密钥不匹配时的错误抛出机制 - 修复了自动加载列表的获取和映射处理 - 统一了代码格式和空格规范 --- repo/js/AutoPlanDomain/config/config.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/repo/js/AutoPlanDomain/config/config.js b/repo/js/AutoPlanDomain/config/config.js index 3aa41ea4a..d89815cc0 100644 --- a/repo/js/AutoPlanDomain/config/config.js +++ b/repo/js/AutoPlanDomain/config/config.js @@ -394,7 +394,12 @@ async function initConfig() { list: ["如雷的盛怒", "平息鸣雷的尊者"] } ]*/ - + config.info.key = settings.key || config.info.key + if (config.info?.key) { + if (config.info.key !== config.info.manifest?.key) { + throw new Error("密钥不匹配!") + } + } const domainList = JSON.parse(file.readTextSync(config.path.domain)) || [{ name: undefined, type: undefined, @@ -427,8 +432,8 @@ async function initConfig() { if (config.domainList.length <= 0) { throw new Error("配置文件缺失或读取异常!") } - let loadList = await getValueByMultiCheckboxName('auto_load')|| [] - const loads= loadList.map(item => LoadMap.get(item)) + let loadList = await getValueByMultiCheckboxName('auto_load') || [] + const loads = loadList.map(item => LoadMap.get(item)) config.domain.loads = loads config.user.uid = await ocrUid() }