fix(viewer): fix login view visibility and transition behavior
This commit is contained in:
+12
-1
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user