|
@@ -2,18 +2,22 @@ import axios from 'axios'
|
|
|
import { MessageBox, Message } from 'element-ui'
|
|
|
import store from '@/store'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
-import Cookies from 'js-cookie';
|
|
|
+import Cookies from 'js-cookie';
|
|
|
|
|
|
//获取当前url
|
|
|
const DoMainString = document.querySelector("html").getAttribute("domain");
|
|
|
var URL = process.env.VUE_APP_BASE_API
|
|
|
if (DoMainString) {
|
|
|
URL = DoMainString
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+var reg = /http:\/\/.*\.[0-9]{1,4}(:[\w]+)?/g
|
|
|
+var browserUrl = window.location.hostname
|
|
|
|
|
|
-if(URL.indexOf('/')==0 && URL.length==1){
|
|
|
- URL= window.location.protocol + "//"+window.location.host+URL
|
|
|
+if (reg.test(browserUrl)){
|
|
|
+ URL = browserUrl
|
|
|
}
|
|
|
+
|
|
|
Cookies.set('url',URL)
|
|
|
console.log(process.env.VUE_APP_BASE_API,'===========URL1111')
|
|
|
console.log(URL,'===========URL')
|