From d246486068c30feb581b0de5351e4aa3e324d5d5 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Mon, 23 Mar 2026 00:21:57 +0800 Subject: [PATCH] update --- frontend/admin.html | 2 +- frontend/css/style.css | 31 +++++++++++++++++-------------- frontend/index.html | 18 +++++++++--------- frontend/js/app.js | 14 ++++++++++++++ frontend/login.html | 2 +- frontend/real-trading.html | 4 ++-- frontend/signals.html | 2 +- frontend/trading.html | 4 ++-- 8 files changed, 47 insertions(+), 30 deletions(-) diff --git a/frontend/admin.html b/frontend/admin.html index 9b94aaa..8cf60d9 100644 --- a/frontend/admin.html +++ b/frontend/admin.html @@ -455,7 +455,7 @@ - + + - + diff --git a/frontend/js/app.js b/frontend/js/app.js index cad7a24..195fe8c 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -25,6 +25,13 @@ createApp({ this.sessionId = this.generateSessionId(); this.autoResizeTextarea(); this.loadModels(); + + // 键盘 Escape 关闭模态框 + document.addEventListener('keydown', this.handleKeydown); + }, + + beforeUnmount() { + document.removeEventListener('keydown', this.handleKeydown); }, methods: { checkAuth() { @@ -40,6 +47,13 @@ createApp({ } }, + handleKeydown(e) { + if (e.key === 'Escape') { + if (this.showImageModal) this.closeImageModal(); + else if (this.showContactModal) this.showContactModal = false; + } + }, + logout() { localStorage.removeItem('token'); window.location.href = '/static/login.html'; diff --git a/frontend/login.html b/frontend/login.html index 5b62370..14b9e6d 100644 --- a/frontend/login.html +++ b/frontend/login.html @@ -221,7 +221,7 @@ - + - + + + - + +