seimin %!s(int64=3) %!d(string=hai) anos
pai
achega
0d28873de3
Modificáronse 2 ficheiros con 4 adicións e 1 borrados
  1. 3 0
      src/main.js
  2. 1 1
      src/views/Login.vue

+ 3 - 0
src/main.js

@@ -11,6 +11,9 @@ import "lib-flexible";
11 11
 import "./filters";
12 12
 Vue.use(Cube);
13 13
 // 设置默认请求接口(删掉地址栏中的后缀)
14
+let domainName = document.domain; //域名
15
+let protocolName = document.location.protocol; //http协议
16
+axios.defaults.baseURL = protocolName + "//" + domainName;
14 17
 // axios.defaults.baseURL = http.host;
15 18
 // axios.defaults.timeout = 5000;
16 19
 axios.defaults.headers["Content-Type"] = "application/json;charset=UTF-8";

+ 1 - 1
src/views/Login.vue

@@ -121,7 +121,7 @@ export default {
121 121
     // 登陆
122 122
     login() {
123 123
       var that = this;
124
-      that.$http.post("service/auth/wechatAuth", {}).then(function(res) {
124
+      that.$http.post("service/auth/wechatAuth", {}).then((res) => {
125 125
         if (res.data.url) {
126 126
           window.location.href = res.data.url;
127 127
         } else {