Skip to content

Commit 10a4eb8

Browse files
committed
2 parents e988f48 + 7de3227 commit 10a4eb8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/common/commonConfig.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ const CommonConfig = [{
3939
]
4040
}];
4141

42-
export default CommonConfig;
42+
export default CommonConfig;
43+
44+
export const commonConfigVal = CommonConfig[0].config.reduce((acc, cur) => {
45+
acc[cur.name] = cur.default;
46+
return acc;
47+
}, {});

src/system/script.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { globalRoot, globalRootType } from '@/system/GlobalStore/index';
2121
import schedule, { Job } from '@/system/Schedule';
2222
import { MyFloaty } from '@/system/MyFloaty';
2323
import ncnnBgyx from '@/system/ncnn/ncnnBgyx';
24+
import { commonConfigVal } from '@/common/commonConfig';
2425

2526
/**
2627
* 脚本对象,一个程序只能有一个
@@ -627,7 +628,8 @@ export class Script {
627628
break;
628629
}
629630
} else {
630-
flag = self.desc(tarFuncList[i], staredSchemeList[j].commonConfig);
631+
const cmcfg = Object.assign({}, commonConfigVal, staredSchemeList[j]?.commonConfig || {});
632+
flag = self.desc(tarFuncList[i], cmcfg);
631633
funcDescCess[tarFuncList[i].id] = flag;
632634
if (flag) {
633635
break;

0 commit comments

Comments
 (0)