Skip to content

Commit

Permalink
feat(core): daymiacLoad support http req (Tencent#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj authored and boxizen committed Aug 16, 2021
1 parent 4d2d598 commit 7533b59
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
11 changes: 8 additions & 3 deletions core/js/global/DynamicLoad.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const ContextifyModule = internalBinding('ContextifyModule');

global.dynamicLoad = (path, encode, cb) => {
console.log(`global.__HIPPYCURDIR__ = ${global.__HIPPYCURDIR__},
encode = ${encode}, path = ${path}`);
ContextifyModule.LoadUriContent(global.__HIPPYCURDIR__ + path, encode, cb);
let requestPath = path;
const reg = /^(https?:)?\/\/.+$/;
if (path && !reg.test(path)) {
requestPath = global.__HIPPYCURDIR__ + path;
console.log(`global.__HIPPYCURDIR__: ${global.__HIPPYCURDIR__}`);
}
console.log(`requestPath:${requestPath}|path = ${path}`);
ContextifyModule.LoadUriContent(requestPath, encode, cb);
};
Loading

0 comments on commit 7533b59

Please sign in to comment.