From 16a732559eec96fadee78102915801f9904cdf9a Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 25 Jan 2022 14:41:03 +0800
Subject: [PATCH] +

---
 src/router/axios.js |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/router/axios.js b/src/router/axios.js
index 4319e01..f5f1b35 100644
--- a/src/router/axios.js
+++ b/src/router/axios.js
@@ -6,11 +6,21 @@
  * isToken是否需要token
  */
 import axios from "axios";
-
+let httpName = window.location.hostname;
+let url =
+  window.location.hostname.indexOf("192.168") != -1
+    ? "http://" + httpName + "/apis"
+    : "https://" + httpName + "/apis";
+// setTimeout(() => {
+//   console.log("https://" + httpName + "/apis");
+//   console.log(httpName.indexOf(".io"), " httpName");
+// }, 3000);
 const service = axios.create({
   //   baseURL: 'http://192.168.0.107:83',
   // baseURL: 'http://192.168.0.107:80',
-  baseURL: "http://171.34.197.243:790",
+  baseURL: "http://171.34.197.243:790", //正常接口
+  // baseURL: "https://6e78efa6.cpolar.io/apis", //https接口
+  // baseURL: url, //https接口
   // baseURL: 'http://s16s652780.51mypc.cn/api',
   timeout: 600000, // request timeout
 });

--
Gitblit v1.9.3