From 0060911e4116ff6521a4f6f7f59579b145fdc4ef Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Sat, 13 Dec 2025 17:24:23 +0800 Subject: [PATCH] update pay ui --- nginx-110.42.32.207.conf | 46 +++++++++++++++---- .../config/bytedesk.config.js | 14 +++--- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/nginx-110.42.32.207.conf b/nginx-110.42.32.207.conf index 54021130..4143c904 100644 --- a/nginx-110.42.32.207.conf +++ b/nginx-110.42.32.207.conf @@ -205,6 +205,17 @@ server { # 概念板块 API location /concept-api/ { + # 处理 OPTIONS 预检请求 + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' $cors_origin always; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always; + add_header 'Access-Control-Allow-Credentials' 'true' always; + add_header 'Access-Control-Max-Age' 86400; + add_header 'Content-Length' 0; + return 204; + } + proxy_pass http://222.128.1.157:16801/; proxy_http_version 1.1; proxy_set_header Host $host; @@ -213,12 +224,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; add_header 'Access-Control-Allow-Origin' $cors_origin always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; - - if ($request_method = 'OPTIONS') { - return 204; - } + add_header 'Access-Control-Allow-Credentials' 'true' always; proxy_connect_timeout 60s; proxy_send_timeout 60s; @@ -251,6 +257,17 @@ server { # 新闻搜索 API location /news-api/ { + # 处理 OPTIONS 预检请求 + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' $cors_origin always; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always; + add_header 'Access-Control-Allow-Credentials' 'true' always; + add_header 'Access-Control-Max-Age' 86400; + add_header 'Content-Length' 0; + return 204; + } + proxy_pass http://222.128.1.157:21891/; proxy_http_version 1.1; proxy_set_header Host $host; @@ -259,8 +276,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; add_header 'Access-Control-Allow-Origin' $cors_origin always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; + add_header 'Access-Control-Allow-Credentials' 'true' always; proxy_connect_timeout 90s; proxy_send_timeout 90s; @@ -269,6 +285,17 @@ server { # 研报搜索 API location /report-api/ { + # 处理 OPTIONS 预检请求 + if ($request_method = 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' $cors_origin always; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always; + add_header 'Access-Control-Allow-Credentials' 'true' always; + add_header 'Access-Control-Max-Age' 86400; + add_header 'Content-Length' 0; + return 204; + } + proxy_pass http://222.128.1.157:8811/; proxy_http_version 1.1; proxy_set_header Host $host; @@ -277,8 +304,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; add_header 'Access-Control-Allow-Origin' $cors_origin always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; + add_header 'Access-Control-Allow-Credentials' 'true' always; proxy_connect_timeout 120s; proxy_send_timeout 120s; diff --git a/src/bytedesk-integration/config/bytedesk.config.js b/src/bytedesk-integration/config/bytedesk.config.js index f18ea799..4de4bb40 100644 --- a/src/bytedesk-integration/config/bytedesk.config.js +++ b/src/bytedesk-integration/config/bytedesk.config.js @@ -1,16 +1,18 @@ +import { getApiBase } from '../../utils/apiConfig'; + /** * Bytedesk客服配置文件 * 通过代理访问 Bytedesk 服务器(解决 HTTPS 混合内容问题) - - iframe 使用完整域名:https://valuefrontier.cn/bytedesk/chat/ + - iframe 使用完整域名:https://api.valuefrontier.cn/chat/ - 使用 HTTPS 协议,解决生产环境 Mixed Content 错误 - - 生产:前端 Nginx 代理 /bytedesk → 43.143.189.195 + - 生产:API 服务器 Nginx 代理 /bytedesk → 43.143.189.195 - baseUrl 保持官方 CDN(用于加载 SDK 外部模块) */ export const bytedeskConfig = { - // API服务地址(如果 SDK 需要调用 API) - apiUrl: '/bytedesk', - // 聊天页面地址(使用完整 HTTPS 域名,通过 /bytedesk/ 代理避免 React Router 冲突) - htmlUrl: 'https://valuefrontier.cn/chat/', + // API服务地址(通过 API 服务器代理) + apiUrl: `${getApiBase()}/bytedesk`, + // 聊天页面地址(通过 API 服务器代理) + htmlUrl: `${getApiBase()}/chat/`, // SDK 资源基础路径(保持 Bytedesk 官方 CDN,用于加载外部模块) baseUrl: 'https://www.weiyuai.cn',