fix(admin): 模板ID匹配改由后端裁决并 trim,修复"ID明明一致却报不属于该小程序"的误报

- 拉取模板列表接口在后端统一 trim 后比对,返回 mismatched 结论(含两侧空白差异场景)
- 后台改为直接展示后端结论,避免前端字符串比对误报
- 回归 87 套件/637 用例全绿
这个提交包含在:
xcbyy
2026-10-19 11:06:47 +08:00
父节点 b77827522f
当前提交 eb592dc1b9
共有 3 个文件被更改,包括 24 次插入 和 14 次删除

查看文件

@@ -1402,15 +1402,11 @@ const fetchWechatTemplates = async () => {
}
};
// 后台填写的4个模板ID中,哪些不在小程序模板列表里(即为 40037 的元凶)
// 后台填写的4个模板ID中,哪些不在小程序模板列表里(以后端结论为准,避免前端字符串比对误报)
const mismatchedTemplateIds = computed(() => {
const t = wechatTemplates.value;
if (!t || !Array.isArray(t.templates)) return [];
const existing = new Set(t.templates.map((x: any) => String(x.templateId)));
const cfg = t.configured || {};
return Object.entries(cfg)
.filter(([, id]) => id && !existing.has(String(id)))
.map(([key, id]) => `${key}: ${id}`);
if (!t || !Array.isArray(t.mismatched)) return [];
return t.mismatched.map((m: any) => `${m.key}: ${m.templateId}`);
});