From c9301b2d8fc78e8e33b81f2457eebc34dfde5080 Mon Sep 17 00:00:00 2001 From: tangshaojian <63377964@qq.com> Date: Thu, 24 Apr 2025 14:03:26 +0800 Subject: [PATCH] =?UTF-8?q?tsj:=20=E4=BF=AE=E6=94=B9cooglMap=20js=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/nginx.conf | 32 +++++++++---------- .../DistrictMapCustomized/loadArea-1.3.1.js | 6 ++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/config/nginx.conf b/config/nginx.conf index ade88614..aaedbd40 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -28,22 +28,22 @@ proxy_redirect default; } - location /region { - rewrite ^/region/(.*)$ /kelan/$1 break; - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; - add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - proxy_pass https://10.1.174.34:13600; - proxy_redirect default; - } + # location /region { + # rewrite ^/region/(.*)$ /kelan/$1 break; + # add_header Access-Control-Allow-Origin *; + # add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + # add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + # proxy_pass https://10.1.174.34:13600; + # proxy_redirect default; + # } - location /grid-range { - rewrite ^/grid-range/(.*)$ /grid-range/$1 break; - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; - add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - proxy_pass https://10.1.174.34:13600; - proxy_redirect default; - } + # location /grid-range { + # rewrite ^/grid-range/(.*)$ /grid-range/$1 break; + # add_header Access-Control-Allow-Origin *; + # add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + # add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + # proxy_pass https://10.1.174.34:13600; + # proxy_redirect default; + # } } \ No newline at end of file diff --git a/src/pages/Home_v_2504/components/MapContainer/DistrictMapCustomized/loadArea-1.3.1.js b/src/pages/Home_v_2504/components/MapContainer/DistrictMapCustomized/loadArea-1.3.1.js index 92c56680..34aebaa1 100644 --- a/src/pages/Home_v_2504/components/MapContainer/DistrictMapCustomized/loadArea-1.3.1.js +++ b/src/pages/Home_v_2504/components/MapContainer/DistrictMapCustomized/loadArea-1.3.1.js @@ -8,6 +8,8 @@ const CooGL = window.CooGL; // 调试开关 const DEBUG = false; +const IS_PROD = process.env.NODE_ENV === 'production' ? true : false; + // API基础URL配置 const API_BASE_URLS = { // 直接地址 @@ -17,8 +19,8 @@ const API_BASE_URLS = { }, // 相对地址(代理) PROXY: { - REGION_API: '/region/coogl/api', - GRID_RANGE_API: '/grid-range' + REGION_API: IS_PROD?'/cd-comprehensive/region/coogl/api':'/region/coogl/api', + GRID_RANGE_API: IS_PROD?'/cd-comprehensive/grid-range':'/grid-range' } }; -- GitLab