fix: 收口依赖兼容与会话撤销

为 miniprogram-ci 和 Jimp 依赖增加兼容 patch 与 smoke test;修复平台模板管理员路由漏配;收紧模板契约校验;为 admin/customer 增加 token 撤销和集中会话存储;同步品牌切换角色、doctor source hash、多屏宽截图证据和 CI 构建门禁。
This commit is contained in:
que01 committed 2026-10-18 23:43:25 +08:00
1 parent 4f0b50c7f1
commit 3017e3eb49
65 files changed
+1623 -975

No files matched your search

@@ -74,6 +74,29 @@ test("template contract rejects technical or incomplete admin declarations", ()
]);
});
test("template package manifests reject mismatched visual keys and empty visual presentation", () => {
const manifestPath = path.join(packageRoot, "template-acheng-campus-food/template.json");
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
manifest.visualTemplateKey = "different-visual";
assert.ok(
validateTemplatePackageManifest(manifest).includes("visualTemplateKey must match packageKey"),
);
manifest.visualTemplateKey = manifest.packageKey;
manifest.visualPresentation = {
description: "无效视觉",
variants: {},
theme: { colors: {}, radius: {} },
layout: { home: [], offerings: [], detail: [], profile: [] },
};
assert.deepEqual(validateTemplatePackageManifest(manifest), [
"visualPresentation.variants requires hero, offeringList and detail",
"visualPresentation.theme.colors requires background, foreground, accent and dark",
"visualPresentation.theme.radius requires card",
"visualPresentation.layout must contain non-empty page module arrays",
]);
});
test("template package manifests must declare package-owned visual presentation", () => {
const manifestPath = path.join(packageRoot, "template-acheng-campus-food/template.json");
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
@@ -83,10 +106,18 @@ test("template package manifests must declare package-owned visual presentation"
]);
manifest.visualPresentation = {
description: "无效视觉",
variants: { hero: "hero" },
theme: { colors: { background: "#fff" }, radius: { card: "16rpx" } },
layout: { home: ["hero"], offerings: [], detail: [], profile: [] },
description: "有效视觉",
variants: { hero: "hero", offeringList: "service-list", detail: "case" },
theme: {
colors: { background: "#fff", foreground: "#111", accent: "#333", dark: "#000" },
radius: { card: "16rpx" },
},
layout: {
home: ["hero"],
offerings: ["service-list"],
detail: ["case"],
profile: ["contact"],
},
};
assert.deepEqual(validateTemplatePackageManifest(manifest), []);
});