From 9a56fbab73608cbc435cd7fde8eb975a8e26349b Mon Sep 17 00:00:00 2001 From: yan Date: Tue, 10 Feb 2026 02:38:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E4=BF=AE=E5=A4=8D=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=AF=86=E9=92=A5=E9=AA=8C=E8=AF=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 checkKey 函数以安全访问嵌套的 manifest.key 属性 - 移除重复的密钥匹配检查逻辑 - 添加对 config.info.manifest.key 的空值检查 - 统一使用 checkKey 函数进行密钥验证 - 简化 initConfig 函数中的密钥处理流程 --- repo/js/AutoPlanDomain/config/config.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/repo/js/AutoPlanDomain/config/config.js b/repo/js/AutoPlanDomain/config/config.js index 01af38466..1cec40319 100644 --- a/repo/js/AutoPlanDomain/config/config.js +++ b/repo/js/AutoPlanDomain/config/config.js @@ -151,7 +151,7 @@ async function getValueByMultiCheckboxName(name) { * 检查密钥是否正确 */ async function checkKey(key = "") { - if (config.info.key !== key.trim()) { + if (config?.info?.manifest?.key !== key?.trim()) { throw new Error("密钥错误"); } } @@ -162,11 +162,7 @@ async function checkKey(key = "") { */ async function initConfig() { config.info.key = settings.key || config.info.key - if (config.info?.key) { - if (config.info.key !== config.info.manifest?.key) { - throw new Error("密钥不匹配!") - } - } + await checkKey(config.info.key) //流程->返回主页 打开地图 返回主页 const physical = await ocrPhysical(true, true) config.user.physical.current = physical.current