@bytenew/bn-applet-ui 1.1.73 → 1.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28743,7 +28743,6 @@ var es_array_sort = __webpack_require__(6910);
28743
28743
 
28744
28744
 
28745
28745
 
28746
-
28747
28746
 
28748
28747
 
28749
28748
  var defaultData = []; //不包括省市级code的数据
@@ -29998,7 +29997,15 @@ function parseAddressByChat(address) {
29998
29997
  console.warn('当前环境不支持 fetch,无法调用大模型地址识别接口');
29999
29998
  return Promise.resolve(null);
30000
29999
  }
30001
- var url = '/v2/project/column/addressBychat?contents=' + address;
30000
+ // 本地开发环境(localhost/127.0.0.1 等)请求前加代理前缀 /proxyWay,走前端 devServer 代理转发;
30001
+ // 非本地环境(线上同域部署)不加前缀
30002
+ var baseUrl = '';
30003
+ if (typeof window !== 'undefined' && window.location) {
30004
+ var hostname = window.location.hostname;
30005
+ var isLocal = hostname === 'localhost' || hostname === '127.0.0.1' || hostname === '0.0.0.0' || hostname === '[::1]';
30006
+ baseUrl = isLocal ? '/proxyWay' : '';
30007
+ }
30008
+ var url = baseUrl + '/v2/project/column/addressBychat?contents=' + encodeURIComponent(address);
30002
30009
  return fetch(url, {
30003
30010
  method: 'GET'
30004
30011
  }).then(function (r) {