修改上传图片安全验证问题

This commit is contained in:
张成
2026-02-14 12:59:21 +08:00
parent 8688b6b82d
commit 64f0267457
54 changed files with 239 additions and 240 deletions

View File

@@ -256,7 +256,7 @@ const RadarChartV2 = forwardRef<RadarChartV2Ref, RadarChartV2Props>(
const bgImg = await loadImage(canvas, shareBgUrl);
ctx.drawImage(bgImg, 0, 0, width, height);
} catch (error) {
console.error("Failed to load background image:", error);
console.warn("Failed to load background image:", error);
// 如果加载失败,使用白色背景作为兜底
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0, 0, width, height);
@@ -392,12 +392,12 @@ const RadarChartV2 = forwardRef<RadarChartV2Ref, RadarChartV2Props>(
);
ctx.restore();
} catch (error) {
console.error("Failed to load docCopy image:", error);
console.warn("Failed to load docCopy image:", error);
}
currentY += (48 + 20) * scale; // 头像区域高度 + gap
} catch (error) {
console.error("Failed to load avatar image:", error);
console.warn("Failed to load avatar image:", error);
}
}
@@ -523,7 +523,7 @@ const RadarChartV2 = forwardRef<RadarChartV2Ref, RadarChartV2Props>(
iconSize,
);
} catch (error) {
console.error("Failed to load icon:", error);
console.warn("Failed to load icon:", error);
}
// 绘制底部文字
@@ -601,7 +601,7 @@ const RadarChartV2 = forwardRef<RadarChartV2Ref, RadarChartV2Props>(
// 恢复上下文状态
ctx.restore();
} catch (error) {
console.error("Failed to load QR code:", error);
console.warn("Failed to load QR code:", error);
}
}