From 4cb1da29d4fd611bf074727bb469127562ca67ff Mon Sep 17 00:00:00 2001 From: saopig1 <4x7sw862st@gmail.com> Date: Tue, 30 Jun 2026 21:11:53 +0800 Subject: [PATCH] fix(web): render login QR codes dark-on-light so scanners can read them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QR images used theme-aware colours, so in the default dark theme they were rendered light-on-dark (inverted). Many in-app scanners — notably the Kugou music app — cannot decode an inverted QR, so the code looked fine on screen but silently failed to scan. Force standard dark-on-light regardless of theme; the white quiet-zone frames it cleanly in dark mode anyway. Affects all platforms' QR login (netease/qq/bilibili/kugou). Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/views/Settings.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/src/views/Settings.vue b/web/src/views/Settings.vue index 6c95de3..efad80d 100755 --- a/web/src/views/Settings.vue +++ b/web/src/views/Settings.vue @@ -969,13 +969,15 @@ async function startQrLogin(platform: string) { if (qrImg) { qr.dataUrl = qrImg; } else { + // QR codes must be dark-on-light to stay scannable. Do NOT invert the + // colours for the dark theme: many in-app scanners (notably the Kugou + // music app) cannot decode a light-on-dark QR, so a themed code looks + // fine on screen but silently fails to scan. The white quiet-zone frames + // it cleanly in dark mode anyway. qr.dataUrl = await QRCode.toDataURL(qrUrl, { width: 200, margin: 2, - color: { - dark: store.theme === 'dark' ? '#ffffff' : '#000000', - light: store.theme === 'dark' ? '#2a2a2a' : '#ffffff', - }, + color: { dark: '#000000', light: '#ffffff' }, }); }