fix: 个人微信二维码改为后端生成真正可扫的 PNG(前端 <img> 原渲染 HTML URL 失效)

This commit is contained in:
WorkBuddy committed 2026-07-09 21:29:50 +08:00
1 parent 75a708a14d
commit 950f86325a
2 files changed
+19 -4

No files matched your search

+3 -3
View File
@@ -146,11 +146,11 @@ const WechatBot: React.FC = () => {
</div>
) : (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '12px' }}>
{qrcode.qrcode_img_content ? (
<img src={qrcode.qrcode_img_content} alt="微信扫码" style={{ width: '220px', height: '220px', background: '#fff', borderRadius: '8px', border: '1px solid #E5E7EB' }} />
{qrcode.qrcode_img ? (
<img src={qrcode.qrcode_img} alt="微信扫码" style={{ width: '220px', height: '220px', background: '#fff', borderRadius: '8px', border: '1px solid #E5E7EB' }} />
) : (
<div style={{ width: '220px', height: '220px', display: 'flex', alignItems: 'center', justifyContent: 'center', background: '#fff', borderRadius: '8px', border: '1px solid #E5E7EB', fontSize: '12px', color: '#9CA3AF', textAlign: 'center', padding: '12px' }}>
二维码数据缺失,请重新获取。
二维码图片生成失败,<a href={qrcode.qrcode_img_content} target="_blank" rel="noreferrer" style={{color:'#6C63FF'}}>请点击此处在新标签页打开</a>。
</div>
)}
<div style={{ fontSize: '13px', color: polling ? '#f59e0b' : '#6B7280' }}>