Quellcode durchsuchen

4.0.30 修复 API 路径//的bug

YangZhiJie vor 2 Jahren
Ursprung
Commit
0b8f598334
2 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. 1 1
      package.json
  2. 5 1
      src/common/Common.js

+ 1 - 1
package.json

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

+ 5 - 1
src/common/Common.js

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