swpp-backends 2.3.8 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DomBuilder.js +7 -2
- package/package.json +1 -1
package/dist/DomBuilder.js
CHANGED
|
@@ -20,8 +20,13 @@ function buildDomJs() {
|
|
|
20
20
|
throw '功能未开启';
|
|
21
21
|
}
|
|
22
22
|
let template = fs_1.default.readFileSync(path_1.default.resolve('./', module.path, 'resources/sw-dom.js'), 'utf-8');
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const key = 'const {onSuccess} = require(\'../config\')';
|
|
24
|
+
if (config.onsuccess) {
|
|
25
|
+
template = template.replaceAll(key, `const onSuccess = ${config.onsuccess.toString()};`);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
template = template.replaceAll(key, '');
|
|
29
|
+
}
|
|
25
30
|
return template;
|
|
26
31
|
}
|
|
27
32
|
exports.buildDomJs = buildDomJs;
|