标准化,图片上传s3
Vercel Deploy / deploy (push) Successful in 56s

This commit is contained in:
2026-04-26 10:51:09 +08:00
Unverified
parent efec4bf735
commit a838ed0564
13 changed files with 4 additions and 5766 deletions
+4 -4
View File
@@ -138,7 +138,7 @@
const img = document.getElementById('cert-img'); const img = document.getElementById('cert-img');
const hint = document.getElementById('click-hint'); const hint = document.getElementById('click-hint');
if (img.src && img.complete) { if (img.src && img.complete && img.naturalWidth > 0) {
img.style.display = 'block'; img.style.display = 'block';
if (hint) hint.style.display = 'none'; if (hint) hint.style.display = 'none';
return; return;
@@ -148,14 +148,14 @@
hint.innerHTML = '<span class="hint-orb">载</span><strong>图片加载中</strong><span>正在读取证书原件,请稍候。</span>'; hint.innerHTML = '<span class="hint-orb">载</span><strong>图片加载中</strong><span>正在读取证书原件,请稍候。</span>';
} }
img.src = `img/${certNumber}.svg`; img.src = `https://s3.biss.click/CERTS/${encodeURIComponent(certNumber)}.svg`;
img.onload = () => { img.onload = () => {
img.style.display = 'block'; img.style.display = 'block';
if (hint) hint.style.display = 'none'; if (hint) hint.style.display = 'none';
}; };
img.onerror = () => { img.onerror = () => {
if (hint) { if (hint) {
hint.innerHTML = '<span class="hint-orb">!</span><strong>图片加载失败</strong><span>未找到对应证书图片文件,请检查 `img` 目录资源。</span>'; hint.innerHTML = '<span class="hint-orb">!</span><strong>图片加载失败</strong><span>未找到对应证书图片文件</span>';
} }
}; };
} }
@@ -188,7 +188,7 @@
img.onerror = () => { img.onerror = () => {
reject(new Error('证书图片加载失败')); reject(new Error('证书图片加载失败'));
}; };
img.src = `img/${certNumber}.svg`; img.src = `https://s3.biss.click/CERTS/${encodeURIComponent(certNumber)}.svg`;
}); });
} }
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.9 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.9 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.9 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.0 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.1 MiB