|
@@ -9,22 +9,22 @@ import { MessageBox, Message } from 'element-ui'
|
|
|
|
|
|
//自动打包、让内外网都能登陆的设置,但是npm run dev 后只能选localhost展示了
|
|
|
//后端框架才需要这段——本地手动打包时可注释
|
|
|
-// const DoMainString = document.querySelector("html").getAttribute("domain");
|
|
|
-// axios.defaults.baseURL = process.env.VUE_APP_BASE_API
|
|
|
-// if (DoMainString) {
|
|
|
-// axios.defaults.baseURL = DoMainString
|
|
|
-// }
|
|
|
-
|
|
|
-// var reg = /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
|
|
|
-// var browserUrl = window.location.hostname
|
|
|
-// if (reg.test(browserUrl)){
|
|
|
-// axios.defaults.baseURL = window.location.protocol +"//"+ browserUrl + ":8087/"
|
|
|
-// }
|
|
|
+const DoMainString = document.querySelector("html").getAttribute("domain");
|
|
|
+axios.defaults.baseURL = process.env.VUE_APP_BASE_API
|
|
|
+if (DoMainString) {
|
|
|
+ axios.defaults.baseURL = DoMainString
|
|
|
+}
|
|
|
+
|
|
|
+var reg = /(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)\.(25[0-5]|2[0-4]\d|[0-1]\d{2}|[1-9]?\d)/;
|
|
|
+var browserUrl = window.location.hostname
|
|
|
+if (reg.test(browserUrl)){
|
|
|
+ axios.defaults.baseURL = window.location.protocol +"//"+ browserUrl + ":8087/"
|
|
|
+}
|
|
|
//后端框架才需要这段——本地手动打包时可注释
|
|
|
|
|
|
|
|
|
//正常本地打包地址
|
|
|
-axios.defaults.baseURL = process.env.VUE_APP_BASE_API
|
|
|
+//axios.defaults.baseURL = process.env.VUE_APP_BASE_API
|
|
|
|
|
|
|
|
|
|