feat: 建立小程序标准模块注册表
This commit is contained in:
1 parent
cdce8227bc
commit
0867585f65
4 files changed
+43
-10
No files matched your search
@@ -1,5 +1,6 @@
|
||||
const { request } = require("./request");
|
||||
const fallback = require("./linjing-data");
|
||||
const { resolveRuntime } = require("./module-registry");
|
||||
|
||||
function toOffering(item) {
|
||||
const config = item && item.config && typeof item.config === "object" ? item.config : {};
|
||||
@@ -21,7 +22,7 @@ function loadWorkspace() {
|
||||
const offerings = Array.isArray(workspace && workspace.offerings)
|
||||
? workspace.offerings.map(toOffering)
|
||||
: fallback.offerings;
|
||||
return { ...workspace, brand, offerings, trustContent: fallback.trustContent };
|
||||
return { ...workspace, ...resolveRuntime(workspace), brand, offerings, trustContent: fallback.trustContent };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,8 +32,9 @@ function loadWorkspaceWithFallback() {
|
||||
brand: fallback.brand,
|
||||
offerings: fallback.offerings,
|
||||
trustContent: fallback.trustContent,
|
||||
modules: [],
|
||||
capabilities: [],
|
||||
theme: resolveRuntime({}).theme,
|
||||
modules: [],
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user