diff --git a/public/viewer.html b/public/viewer.html
index 4fe9c87..f99be1d 100644
--- a/public/viewer.html
+++ b/public/viewer.html
@@ -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 {