Skip to content

[optimize] uuid compatibility && [bug] fix img dom not find #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[bug] fix not find img dom
  • Loading branch information
Hiram committed Dec 22, 2024
commit 918aad01a06edad7d1a261da9078e870d8b5bd5c
4 changes: 2 additions & 2 deletions apps/cookie-butler/static/js/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ async function scanCode(platform) {
if (timeoutTimer) clearTimeout(timeoutTimer);

const qrcode_expired = './static/img/qrcode_expired.jpg';
const img = document.getElementById('qrcode');

try {
// 获取二维码
const qrData = await qrcode_handler.startScan(platform);

// 显示二维码
const img = document.getElementById('qrcode');
img.src = qrData.qrcode;

// 开始轮询扫码结果
Expand Down Expand Up @@ -116,10 +116,10 @@ async function scanCode(platform) {
}, 30000);

} catch (error) {
console.log(error)
if (pollInterval) clearInterval(pollInterval);
if (timeoutTimer) clearTimeout(timeoutTimer);
img.src = qrcode_expired;
showToast(`获取二维码失败:${error.message}`, 'error');
}
}