fix(config): 解决配置密钥验证和加载列表处理问题

- 添加了配置密钥验证逻辑,确保密钥匹配
- 实现了密钥不匹配时的错误抛出机制
- 修复了自动加载列表的获取和映射处理
- 统一了代码格式和空格规范
This commit is contained in:
yan
2026-02-08 15:18:28 +08:00
parent c8294148bc
commit d96eea7777

View File

@@ -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()
}