refactor: 按模板隔离小程序 fallback 数据

This commit is contained in:
que01 committed 2026-09-23 02:01:07 +08:00
1 parent bfa24d48d0
commit b525c4d29a
2 files changed
+36 -10

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
const doorFallback = require("./linjing-data");
const base = (name, tagline) => ({
schemaVersion: "fallback-1.0",
brand: {
id: "fallback",
name,
tagline,
description: "以专业经验建立长期信任。",
contactPhone: "",
contactWechat: "",
},
offerings: [],
trustContent: [],
fields: [],
modules: [],
capabilities: [],
theme: {},
});
const fallbacks = {
doors: { ...doorFallback, schemaVersion: "fallback-doors-1.0", template: { key: "doors" } },
food: base("个人品牌", "私房菜与定制服务"),
personal: base("个人品牌", "专业经验与可信赖的合作方式"),
};
function getFallbackWorkspace(templateKey) {
return fallbacks[templateKey] || fallbacks.personal;
}
module.exports = { getFallbackWorkspace };