fix(viewer): fix login view visibility and transition behavior
This commit is contained in:
+12
-1
@@ -21,6 +21,10 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
@@ -425,7 +429,14 @@
|
||||
if (!res.ok) {
|
||||
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) {
|
||||
error.textContent = e.message;
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user