fix: 收口模板契约与安全门禁
统一模板包 visual 契约并补齐完成证据;修复 release 版本一致性、管理员 token 撤销、CORS 与默认品牌配置;收敛依赖安全风险并完成全量回归验证。
This commit is contained in:
1 parent
456171aa85
commit
4f0b50c7f1
84 files changed
+7367
-5180
No files matched your search
@@ -74,6 +74,23 @@ test("template contract rejects technical or incomplete admin declarations", ()
|
||||
]);
|
||||
});
|
||||
|
||||
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"));
|
||||
delete manifest.visualPresentation;
|
||||
assert.deepEqual(validateTemplatePackageManifest(manifest), [
|
||||
"visualPresentation requires description, variants, theme.colors and theme.radius",
|
||||
]);
|
||||
|
||||
manifest.visualPresentation = {
|
||||
description: "无效视觉",
|
||||
variants: { hero: "hero" },
|
||||
theme: { colors: { background: "#fff" }, radius: { card: "16rpx" } },
|
||||
layout: { home: ["hero"], offerings: [], detail: [], profile: [] },
|
||||
};
|
||||
assert.deepEqual(validateTemplatePackageManifest(manifest), []);
|
||||
});
|
||||
|
||||
test("template admin sections must point to a declared Mini Program page", () => {
|
||||
const manifestPath = path.join(packageRoot, "template-acheng-campus-food/template.json");
|
||||
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
||||
|
||||
Reference in new issue
Block a user