|
|
@@ -74,6 +74,7 @@
|
|
|
theRequest[strS[i].split("=")[0]]=(strS[i].split("=")[1]);
|
|
|
}
|
|
|
}
|
|
|
+ console.log(theRequest);
|
|
|
return theRequest.code;
|
|
|
},
|
|
|
judgeLogin(){
|
|
|
@@ -117,42 +118,44 @@
|
|
|
});
|
|
|
},
|
|
|
sendCodeRequest(){
|
|
|
- let that = this , jsUrl = 'http://fission.xazhima.com/front-page/fission-page.html';
|
|
|
- axios({
|
|
|
- method: 'post', //请求方式 有常用的有get post等
|
|
|
- url: apiUrl, //请求地址
|
|
|
- data: {
|
|
|
- method: 'wxinfo',
|
|
|
- timestamp: 11111111,
|
|
|
- code:that.weChatCode,
|
|
|
- jsUrl:jsUrl,
|
|
|
- sign:md5('wxinfo'+'11111111')
|
|
|
- }, //代表传过去的参数对象,
|
|
|
- transformRequest: [function(data) {
|
|
|
- let ret = '';
|
|
|
- for (let it in data) {
|
|
|
- ret += encodeURIComponent(it) + '=' +
|
|
|
- encodeURIComponent(data[it]) + '&'
|
|
|
- }
|
|
|
- return ret
|
|
|
- }], //将传参修改为formData格式 注释则为JSON格式
|
|
|
- }).then(function(rs) {
|
|
|
- if(rs.data.code === 200) {
|
|
|
- that.setWxConfig(rs.data.msg.js_sign);
|
|
|
- that.headSrc = rs.data.msg.headimgurl;
|
|
|
- that.isFollow = rs.data.msg.subscribe;
|
|
|
- that.openId = rs.data.msg.openid;
|
|
|
- }else {
|
|
|
- alert(rs.data.msg)
|
|
|
- }
|
|
|
- }).catch(function(e) {
|
|
|
- console.log(e);
|
|
|
- });
|
|
|
+ let that = this , jsUrl = location.href.split('#')[0];
|
|
|
+ that.weChatCode = that.subStrUrlCode();
|
|
|
+ console.log(jsUrl);
|
|
|
+ // axios({
|
|
|
+ // method: 'post', //请求方式 有常用的有get post等
|
|
|
+ // url: apiUrl, //请求地址
|
|
|
+ // data: {
|
|
|
+ // method: 'wxinfo',
|
|
|
+ // timestamp: 11111111,
|
|
|
+ // code:that.weChatCode,
|
|
|
+ // jsUrl:jsUrl,
|
|
|
+ // sign:md5('wxinfo'+'11111111')
|
|
|
+ // }, //代表传过去的参数对象,
|
|
|
+ // transformRequest: [function(data) {
|
|
|
+ // let ret = '';
|
|
|
+ // for (let it in data) {
|
|
|
+ // ret += encodeURIComponent(it) + '=' +
|
|
|
+ // encodeURIComponent(data[it]) + '&'
|
|
|
+ // }
|
|
|
+ // return ret
|
|
|
+ // }], //将传参修改为formData格式 注释则为JSON格式
|
|
|
+ // }).then(function(rs) {
|
|
|
+ // if(rs.data.code === 200) {
|
|
|
+ // that.setWxConfig(rs.data.msg.js_sign);
|
|
|
+ // that.headSrc = rs.data.msg.headimgurl;
|
|
|
+ // that.isFollow = rs.data.msg.subscribe;
|
|
|
+ // that.openId = rs.data.msg.openid;
|
|
|
+ // }else {
|
|
|
+ // alert(rs.data.msg)
|
|
|
+ // }
|
|
|
+ // }).catch(function(e) {
|
|
|
+ // console.log(e);
|
|
|
+ // });
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
this.weChatCode = this.subStrUrlCode();
|
|
|
- this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
|
|
|
+ this.weChatCode ? this.sendCodeRequest() : this.judgeLogin()
|
|
|
}
|
|
|
})
|
|
|
|