Jelajahi Sumber

fix:生产环境接口地址调整、解决调用接口api拼两次的问题

liuzhenlin 3 minggu lalu
induk
melakukan
db2a5ee913
4 mengubah file dengan 9 tambahan dan 19 penghapusan
  1. 4 4
      .env.production
  2. 1 4
      .eslintrc.js
  3. 1 0
      .gitignore
  4. 3 11
      src/utils/micro_request.js

+ 4 - 4
.env.production

@@ -2,10 +2,10 @@
 VUE_APP_TENANT=8b9ec443
 
 # websocket地址
-VUE_APP_WEBSOCKET_URL=wss://oms.dashoo.cn/ws
+VUE_APP_WEBSOCKET_URL=/ws/
 
 # GateWay地址
-VUE_APP_MicroSrvProxy_API=https://oms.dashoo.cn/api/
+VUE_APP_MicroSrvProxy_API=/api/
 # 登录验证微服务名称
 VUE_APP_AdminPath=dashoo.opms.admin-0.0.1
 # 业务接口微服务名称
@@ -13,9 +13,9 @@ VUE_APP_ParentPath=dashoo.opms.parent-0.0.1
 
 # 文件上传
 VUE_APP_PROTOCOL='https://'
-VUE_APP_UPLOAD_WEED='https://oms.dashoo.cn/dir/assign'
+VUE_APP_UPLOAD_WEED=/dir/
 # 文件一步上传
-VUE_APP_UPLOAD_FILE_WEED='https://oms.dashoo.cn/weedfs/upload'
+VUE_APP_UPLOAD_FILE_WEED=/weedfs/
 
 
 

+ 1 - 4
.eslintrc.js

@@ -96,10 +96,7 @@ module.exports = {
   },
   overrides: [
     {
-      files: [
-        '**/__tests__/*.{j,t}s?(x)',
-        '**/tests/unit/**/*.spec.{j,t}s?(x)',
-      ],
+      files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
       env: {
         jest: true,
       },

+ 1 - 0
.gitignore

@@ -40,3 +40,4 @@ public/video
 src/vab/styles/themes/red.scss
 /src/vab/styles/themes/red-black.scss
 /src/vab/styles/themes/red-white.scss
+.history/

+ 3 - 11
src/utils/micro_request.js

@@ -74,9 +74,8 @@ service.postRequest = function postRequest(basePath, srvName, funcName, data) {
     data = nullParam
   }
 
-  var base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
   return service.request({
-    url: base_Path,
+    url: basePath,
     method: 'post',
     headers: {
       'Content-Type': 'application/rpcx',
@@ -97,9 +96,8 @@ service.postFormDataRequest = function postRequest(basePath, srvName, funcName,
     data = nullParam
   }
   console.log(getFormData(data))
-  var base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
   return service.request({
-    url: base_Path,
+    url: basePath,
     method: 'post',
     headers: {
       'Content-Type': 'multipart/form-data',
@@ -140,14 +138,8 @@ service.downloadExcel = function downloadExcel(basePath, srvName, funcName, data
     }
     data = nullParam
   }
-  var base_Path = ''
-  if (basePath == process.env.VUE_APP_AdminPath) {
-    base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
-  } else if (basePath == process.env.VUE_APP_ParentPath) {
-    base_Path = process.env.VUE_APP_MicroSrvProxy_API + basePath
-  }
   service.request({
-    url: base_Path,
+    url: basePath,
     method: 'post',
     responseType: 'blob',
     headers: {