mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-30 05:49:51 +08:00
feat(config): 添加UID配置加载开关功能
- 在配置域中新增load_uid_config开关字段 - 实现基于配置开关的OCR UID加载条件判断 - 确保配置缺失时的错误处理机制正常运行 - 保持原有配置验证逻辑完整性 - 添加对settings.load_uid_config的优先级支持
This commit is contained in:
@@ -3,7 +3,8 @@ import {ocrUid} from "../utils/uid";
|
||||
const config = {
|
||||
//setting设置放在这个json
|
||||
domain: {
|
||||
config: ''
|
||||
config: '',
|
||||
load_uid_config: false
|
||||
},
|
||||
info: {
|
||||
key: undefined,//密钥
|
||||
@@ -413,7 +414,10 @@ async function initConfig() {
|
||||
if (config.domainList.length <= 0) {
|
||||
throw new Error("配置文件缺失或读取异常!")
|
||||
}
|
||||
config.user.uid = await ocrUid()
|
||||
config.domain.load_uid_config = settings.load_uid_config || config.domain.load_uid_config
|
||||
if (config.domain.load_uid_config){
|
||||
config.user.uid = await ocrUid()
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user