优化图片和显示问题

This commit is contained in:
24kycj
2026-09-22 17:39:48 +08:00
parent 0f26163ad7
commit 381a48b5c5
12 changed files with 54 additions and 13 deletions
+7
View File
@@ -423,6 +423,13 @@
typeof window.soonBindFileMeta === 'function') {
window.soonBindFileMeta(cacheKey, { name: hit.meta.name });
}
// 兜底:design2(背面文件)若缓存里 j.b 缺失,主动补一个空背面结构,
// 避免 design2.canvas2.loadFromJSON(undefined) 抛错或吃掉整段加载。
if ((hit.json.soonType === 2 || hit.json.backBlackPic || (hit.json.bo && hit.json.bo.length) || (hit.json.f && hit.json.b === undefined && typeof hit.json.b === 'undefined'))) {
if (!hit.json.b || typeof hit.json.b !== 'object' || !Array.isArray(hit.json.b.objects)) {
hit.json.b = { version: '4.6.0', objects: [], hoverCursor: 'move' };
}
}
return Promise.resolve(hit.json);
}