fix(viewer): fix login view visibility and transition behavior

This commit is contained in:
jocayn
2026-06-13 17:33:37 +08:00
parent 61c2a0c004
commit bca5f8f240
+12 -1
View File
@@ -21,6 +21,10 @@
box-sizing: border-box; box-sizing: border-box;
} }
[hidden] {
display: none !important;
}
body { body {
margin: 0; margin: 0;
min-height: 100vh; min-height: 100vh;
@@ -425,7 +429,14 @@
if (!res.ok) { if (!res.ok) {
throw new Error(data.error || '密码不正确'); throw new Error(data.error || '密码不正确');
} }
window.location.href = data.redirectTo || '/sub'; const targetPath = data.redirectTo || '/sub';
if (targetPath === '/sub' || targetPath === '/sub/' || targetPath === window.location.pathname) {
input.value = '';
showHistory();
await loadHistory();
} else {
window.location.href = targetPath;
}
} catch (e) { } catch (e) {
error.textContent = e.message; error.textContent = e.message;
} finally { } finally {