We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ff24e3 commit d0c2f3bCopy full SHA for d0c2f3b
1 file changed
src/pkg/config/config.ts
@@ -68,8 +68,13 @@ export class SystemConfig {
68
}
69
70
public set(key: string, val: any) {
71
- this.cache.set(key, val);
72
- this.storage.set(key, val);
+ if (val === undefined) {
+ this.cache.delete(key);
73
+ this.storage.remove(key);
74
+ } else {
75
+ this.cache.set(key, val);
76
+ this.storage.set(key, val);
77
+ }
78
// 发送消息通知更新
79
this.mq.publish(SystamConfigChange, {
80
key,
@@ -188,7 +193,7 @@ export class SystemConfig {
188
193
189
194
setEslintConfig(v: string) {
190
195
if (v === "") {
191
- this.set("eslint_config", v);
196
+ this.set("eslint_config", undefined);
192
197
Message.success("ESLint规则已重置");
198
return;
199
0 commit comments