wzh 4 лет назад
Родитель
Сommit
7a508f5cc8
2 измененных файлов с 17 добавлено и 6 удалено
  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`;
 const uploadUrl = `${baseurl}cos/upload`;
 import axios from "axios";
 import axios from "axios";

+ 10 - 0
src/store/index.js

@@ -1,4 +1,12 @@
 import { createStore } from "vuex";
 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({
 const store = createStore({
   state: {
   state: {
@@ -6,6 +14,8 @@ const store = createStore({
     firstTitle: "",
     firstTitle: "",
     secondTitle: "",
     secondTitle: "",
     currentMenuItem: "/cargoOwnerManage/cargoOwnerList",
     currentMenuItem: "/cargoOwnerManage/cargoOwnerList",
+    baseurl,
+    uploadUrl,
   },
   },
   mutations: {
   mutations: {
     changefirstTitle(state, text) {
     changefirstTitle(state, text) {