From 2dd8b7ded898d3dc4b51d24e6751d3b37e0937e9 Mon Sep 17 00:00:00 2001 From: CaasianVale <1544257291@qq.com> Date: Sat, 8 Mar 2025 03:09:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E4=BB=A4=E7=89=8C=E5=92=8Cnginx=E4=B8=AD/test=5Fapi=5Fconnecti?= =?UTF-8?q?on=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/nginx.conf | 9 ++ frontend/src/assets/css/global.css | 59 ++++++++++ frontend/src/components/ApiConfigPanel.vue | 109 +++++++++++-------- frontend/src/components/StockAnalysisApp.vue | 22 +++- frontend/src/main.ts | 1 + frontend/src/style.css | 38 ++++++- 6 files changed, 190 insertions(+), 48 deletions(-) create mode 100644 frontend/src/assets/css/global.css diff --git a/frontend/nginx.conf b/frontend/nginx.conf index d07268f..3808961 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -72,6 +72,15 @@ server { proxy_read_timeout 300s; } + location /test_api_connection { + proxy_pass http://backend:8888/test_api_connection; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_cache_bypass $http_upgrade; + } + # 所有其他路由返回index.html(SPA应用需要) location / { try_files $uri $uri/ /index.html; diff --git a/frontend/src/assets/css/global.css b/frontend/src/assets/css/global.css new file mode 100644 index 0000000..08b5b62 --- /dev/null +++ b/frontend/src/assets/css/global.css @@ -0,0 +1,59 @@ +/* 全局样式覆盖 - 专门针对Naive UI组件 */ + +/* 移除所有Naive UI按钮的焦点边框 */ +.n-button:focus, +.n-button:focus-visible { + outline: none !important; + box-shadow: none !important; +} + +/* 为主要按钮添加自定义焦点样式 */ +.n-button--primary:focus, +.n-button--primary:focus-visible { + outline: none !important; + box-shadow: 0 0 0 2px rgba(32, 128, 240, 0.2) !important; +} + +/* 输入框和下拉菜单的焦点样式 */ +.n-input:focus-within, +.n-input-number:focus-within, +.n-select:focus-within { + outline: none !important; + box-shadow: 0 0 0 2px rgba(32, 128, 240, 0.2) !important; +} + +/* 标签的焦点样式 */ +.n-tag:focus { + outline: none !important; + box-shadow: none !important; +} + +/* 移除所有元素的黑色边框 */ +*:focus { + outline: none !important; +} + +/* 移除移动设备上的点击高亮 */ +* { + -webkit-tap-highlight-color: transparent; +} + +/* 修复Firefox特定的焦点样式 */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; +} + +/* 确保所有按钮在点击后不显示边框 */ +button:focus { + outline: none !important; + box-shadow: none !important; +} + +/* 确保所有输入框在点击后显示自定义边框 */ +input:focus, +textarea:focus, +select:focus { + outline: none !important; + box-shadow: 0 0 0 2px rgba(32, 128, 240, 0.2) !important; +} \ No newline at end of file diff --git a/frontend/src/components/ApiConfigPanel.vue b/frontend/src/components/ApiConfigPanel.vue index 2886359..3b02555 100644 --- a/frontend/src/components/ApiConfigPanel.vue +++ b/frontend/src/components/ApiConfigPanel.vue @@ -146,11 +146,17 @@
- - 保存配置到本地 + + + 保存配置到本地 +
@@ -188,7 +194,7 @@