Quellcode durchsuchen

更新 接口逻辑

wzh vor 4 Jahren
Ursprung
Commit
7a508f5cc8
2 geänderte Dateien mit 17 neuen und 6 gelöschten Zeilen
  1. 7 6
      src/apis/config.js
  2. 10 0
      src/store/index.js

+ 7 - 6
src/apis/config.js

@@ -1,9 +1,10 @@
-const baseurl = `${
-  window.location.href.indexOf("localhost") == -1
-    ? "https://interface.huihenduo.com.cn/hhd-pat/"
-    : "https://interface.huihenduo.com.cn/hhd-pat-dev/"
-}`;
-// const baseurl = "https://interface.huihenduo.com.cn/hhd-pat/";
+let baseurl = "https://interface.huihenduo.com.cn/hhd-pat/";
+if (
+  window.location.href.indexOf("localhost") != -1 ||
+  window.location.href.indexOf("test.photo.huihenduo.com.cn") != -1
+) {
+  baseurl = "https://interface.huihenduo.com.cn/hhd-pat-dev/";
+}
 
 const uploadUrl = `${baseurl}cos/upload`;
 import axios from "axios";

+ 10 - 0
src/store/index.js

@@ -1,4 +1,12 @@
 import { createStore } from "vuex";
+let baseurl = "https://interface.huihenduo.com.cn/hhd-pat/";
+if (
+  window.location.href.indexOf("localhost") != -1 ||
+  window.location.href.indexOf("test.photo.huihenduo.com.cn") != -1
+) {
+  baseurl = "https://interface.huihenduo.com.cn/hhd-pat-dev/";
+}
+const uploadUrl = `${baseurl}cos/upload`;
 
 const store = createStore({
   state: {
@@ -6,6 +14,8 @@ const store = createStore({
     firstTitle: "",
     secondTitle: "",
     currentMenuItem: "/cargoOwnerManage/cargoOwnerList",
+    baseurl,
+    uploadUrl,
   },
   mutations: {
     changefirstTitle(state, text) {