Browse Source

[Mod 0000]添加数据中心8062端口号路由处理

wangkeyi 1 day ago
parent
commit
1df861a647
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/utils/http/axios/index.ts

+ 4 - 1
src/utils/http/axios/index.ts

@@ -116,7 +116,10 @@ const transform: AxiosTransform = {
       }
       if (apiUrl && isString(apiUrl)) {
         const firstCode = config.url?.split('/')[1];
-        if (!proxyFixList || !proxyFixList.includes(firstCode)) {
+        const currentPort = window.location.port;
+        if (currentPort === '8062' && !proxyFixList.includes(firstCode)) {
+          config.url = `/dataCenter${config.url}`;
+        } else if (!proxyFixList || !proxyFixList.includes(firstCode)) {
           config.url = `${apiUrl}${config.url}`;
         }
         // if (config.url?.startsWith('/gasServerImg')) {