Ver código fonte

4.0.30 修复 API 路径//的bug

YangZhiJie 2 anos atrás
pai
commit
0b8f598334
2 arquivos alterados com 6 adições e 2 exclusões
  1. 1 1
      package.json
  2. 5 1
      src/common/Common.js

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "4.0.29",
+  "version": "4.0.30",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 5 - 1
src/common/Common.js

@@ -70,7 +70,11 @@ export default {
 
   // 获取API的地址
   getApiURL: function (apiName) {
-    return this.getHostPageBaseURL() + 'api/' + apiName;
+    if(apiName.startsWith("/")){
+      return this.getHostPageBaseURL() + 'api' + apiName;
+    }else{
+      return this.getHostPageBaseURL() + 'api/' + apiName;
+    }
   },
 
   /**