@xuda.io/xuda-worker-bundle-min 1.3.920 → 1.3.922
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/index.js +17 -11
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7220,8 +7220,8 @@ func.utils.get_plugin_resource = function (
|
|
|
7220
7220
|
if (typeof IS_PROCESS_SERVER !== "undefined") {
|
|
7221
7221
|
return `${_conf.plugins_drive_path}/${_session.app_id}/node_modules/${plugin_name}/${resource}`;
|
|
7222
7222
|
} else {
|
|
7223
|
-
return `./node_modules/${plugin_name}/${resource}?app_id=${_session.app_id}`;
|
|
7224
|
-
|
|
7223
|
+
// return `./node_modules/${plugin_name}/${resource}?app_id=${_session.app_id}`;
|
|
7224
|
+
return `https://${_session.domain}/plugins/${plugin_name}/${resource}?app_id=${_session.app_id}`;
|
|
7225
7225
|
}
|
|
7226
7226
|
};
|
|
7227
7227
|
|
|
@@ -7229,20 +7229,26 @@ func.utils.get_plugin_resource = function (
|
|
|
7229
7229
|
const db = await func.utils.connect_pouchdb(SESSION_ID);
|
|
7230
7230
|
|
|
7231
7231
|
try {
|
|
7232
|
-
if (_session.worker_type === "Dev") throw "";
|
|
7232
|
+
if (_session.worker_type === "Dev") throw "bypass cache";
|
|
7233
7233
|
|
|
7234
7234
|
let ret = await db.get(`cache_plugin_${plugin_name}_${plugin_resource}`);
|
|
7235
7235
|
return resolve(ret.data);
|
|
7236
7236
|
} catch (err) {
|
|
7237
|
-
|
|
7238
|
-
|
|
7237
|
+
try {
|
|
7238
|
+
const plugin_resource_res = await import(
|
|
7239
|
+
`${get_path(plugin_resource)}`
|
|
7240
|
+
);
|
|
7241
|
+
resolve(plugin_resource_res);
|
|
7239
7242
|
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7243
|
+
var doc = {
|
|
7244
|
+
_id: `cache_plugin_${plugin_name}_${plugin_resource}`,
|
|
7245
|
+
data: JSON.stringify(plugin_resource_res),
|
|
7246
|
+
docType: "cache_plugin",
|
|
7247
|
+
};
|
|
7248
|
+
// db.put(doc);
|
|
7249
|
+
} catch (err) {
|
|
7250
|
+
console.error(err);
|
|
7251
|
+
}
|
|
7246
7252
|
}
|
|
7247
7253
|
});
|
|
7248
7254
|
};
|