Browse Source

跳过一些没有的接口

sujunling 1 year ago
parent
commit
afb7077304
2 changed files with 10 additions and 2 deletions
  1. 2 2
      .env.development
  2. 8 0
      src/utils/http/axios/index.ts

+ 2 - 2
.env.development

@@ -10,9 +10,9 @@ VITE_GLOB_PUBLIC_PATH = /
 # 本地
 # VITE_PROXY = [["/api","http://192.168.2.225/api"]]
 # 测试环境
-# VITE_PROXY = [["/api","http://117.174.10.73:19200"],["/agent","http://117.174.10.73:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"],["/xldAnalysisApi","http://192.168.119.47:2214/xldanalyst"]]
+VITE_PROXY = [["/api","http://117.174.10.73:19200"],["/agent","http://117.174.10.73:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"],["/xldAnalysisApi","http://192.168.119.47:2214/xldanalyst"]]
 #现场环境
-VITE_PROXY = [["/api","http://192.168.119.143:9200"],["/agent","http://192.168.119.143:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"],["/xldAnalysisApi","http://192.168.119.47:2214/xldanalyst"]]
+# VITE_PROXY = [["/api","http://192.168.119.143:9200"],["/agent","http://192.168.119.143:31895"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"],["/xldAnalysisApi","http://192.168.119.47:2214/xldanalyst"]]
 # VITE_PROXY = [["/api","http://192.168.49.163:20043"],["/agent","http://192.168.49.163:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://127.0.0.1:20043"],["/agent","http://127.0.0.1:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]
 # VITE_PROXY = [["/api","http://192.168.49.163:20043"],["/agent","http://192.168.49.163:20043"],["/iserver","http://221.182.8.141:15000/iserver"],["/onlineIde","http://106.12.170.138:4001/examples"],["/tfDemo","http://106.12.170.138:4001/demo"],["/mapTools","http://106.12.170.138:10090"]]

+ 8 - 0
src/utils/http/axios/index.ts

@@ -144,6 +144,14 @@ const transform: AxiosTransform = {
         window.sessionStorage.clear();
         router.push(PageEnum.BASE_HOME);
       }
+      if ((response?.data?.status == '401' || response?.data?.resp_code == '401') && response.config.url.indexOf('xldanalysis') > -1) {
+        console.log('分析接口报错,现场才有这个接口测试环境和本地不用管!');
+        return Promise.reject(error);
+      }
+      if (response?.data?.resp_code == '500' && response.config.url.indexOf('datasearch-center/space/getDRResourceFileSize') > -1) {
+        console.log('分析接口报错,现场才有这个接口测试环境和本地不用管!');
+        return Promise.reject(error);
+      }
       if ((response?.data?.resp_code == '500'  || response?.data?.status == '500') && response.config.url.indexOf('file/download') > -1) {
         console.log('文件下载失败!');
         return Promise.reject(error);