mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
fix: 修复攻略
This commit is contained in:
parent
2f83ea81a4
commit
075a6d4fd0
4 changed files with 101 additions and 90 deletions
|
|
@ -153,12 +153,31 @@ class Setting {
|
|||
|
||||
/**
|
||||
* 设置对应模块用户配置
|
||||
* @param {'atlas'|'config'|'gacha'|'panel'} app
|
||||
* @param {'atlas'|'config'|'gacha'|'panel'|'guide'} app
|
||||
* @param {object} obj
|
||||
* @returns
|
||||
*/
|
||||
setConfig(app, obj) {
|
||||
return this.setYaml(app, 'config', { ...this.getdefSet(app), ...obj });
|
||||
// 先获取默认配置
|
||||
const defSet = this.getdefSet(app);
|
||||
// 再获取用户配置
|
||||
const config = this.getConfig(app);
|
||||
return this.setYaml(app, 'config', { ...defSet, ...config, ...obj });
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置对应模块用户配置
|
||||
* @param {'atlas'|'config'|'gacha'|'panel'|'guide'} app
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
* @returns {boolean}
|
||||
*/
|
||||
setSingleConfig(app, key, value) {
|
||||
// 先获取默认配置
|
||||
const defSet = this.getdefSet(app);
|
||||
const config = this.getConfig(app);
|
||||
config[key] = value;
|
||||
return this.setYaml(app, 'config', { ...defSet, ...config });
|
||||
}
|
||||
|
||||
// 将对象写入YAML文件
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue