Browse Source

http 地址 根据localhost获取

zhangsijie 2 years atrás
parent
commit
d875d08dfb
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pingpu_vue/src/main.js

+ 2 - 1
pingpu_vue/src/main.js

@@ -24,7 +24,8 @@ const Qs = require("qs");
 Vue.prototype.$axios = axios;
 Vue.prototype.$axios = axios;
 // import qs from 'qs'
 // import qs from 'qs'
 Vue.prototype.qs = Qs; // 全局注册,使用方法为:this.qs
 Vue.prototype.qs = Qs; // 全局注册,使用方法为:this.qs
-Vue.prototype.$http = "http://106.119.196.18:10004";
+// Vue.prototype.$http = "http://106.119.196.18:10004";
+Vue.prototype.$http = window.location.host;
 /* eslint-disable no-new */
 /* eslint-disable no-new */
 const ElementUI = require("element-ui");
 const ElementUI = require("element-ui");
 Vue.use(ElementUI);
 Vue.use(ElementUI);