Skip to content

Commit 671df03

Browse files
committed
fix: resouce manager load local resource
1 parent fa6b2de commit 671df03

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

packages/core/src/asset/ResourceManager.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -573,19 +573,20 @@ export class ResourceManager {
573573
Logger.warn(`refId:${refId} is not find in this._editorResourceConfig.`);
574574
return Promise.resolve(null);
575575
}
576-
const remoteUrl = resourceConfig.path;
577-
const queryPath = new URL(remoteUrl).search;
578-
let url = resourceConfig.virtualPath + queryPath;
579-
if (key) {
580-
url += (url.indexOf("?") > -1 ? "&" : "?") + "q=" + key;
581-
}
582-
576+
const url = resourceConfig.path;
583577
promise = this.load<any>({
584578
url,
585579
type: resourceConfig.type
586580
});
587581
}
588-
return promise.then((item) => (isClone ? item.clone() : item));
582+
return promise.then((item) => {
583+
let resource = item;
584+
if (key) {
585+
const paths = this._parseQueryPath(key);
586+
resource = this._getResolveResource(item, paths);
587+
}
588+
return isClone ? resource.clone() : resource;
589+
});
589590
}
590591

591592
/**

0 commit comments

Comments
 (0)