微信登录

This commit is contained in:
asd 2019-11-29 10:36:10 +08:00
parent 2ddcf19dad
commit 5e1038cf23

View File

@ -30,7 +30,22 @@
<div class="line"></div>
</div>
<div class="icons">
<!-- <div>
<img src="./assets/wechat.png" alt class="icon" />
</div>-->
<div>
<!-- <a
href="https://open.weixin.qq.com/connect/qrconnect?appid=wxfe6e5d36322af62f&redirect_uri=http%3a%2f%2fwww.lawpro.cn%2f&response_type=code&scope=snsapi_login&state=lawpro#wechat_redirect"
> -->
<a
href="https://open.weixin.qq.com/connect/qrconnect?appid=wxfe6e5d36322af62f&redirect_uri=http%3a%2f%2fwww.lawpro.cn%2f&response_type=code&scope=snsapi_login&state=lawpro#wechat_redirect"
>
<!-- <i class="icon-wechatl"></i>微信 -->
<img src="./assets/wechat.png" alt class="icon" />
</a>
</div>
<!-- <img src="./assets/weibo.png" alt class="icon" />
<img src="./assets/qq.png" alt class="icon" />-->
</div>
@ -66,56 +81,71 @@ export default {
},
loginpwd() {
this.$router.push({
path: `/loginpwd`,
})
path: `/loginpwd`
});
},
yz() {
let yz=""
let yz = "";
if (this.tel != "") {
window.console.log("aaaa");
var t =this
this.axios.post("http://lawpro.earnest.pro/api/Main/Verification", {
var t = this;
this.axios
.post("http://lawpro.earnest.pro/api/Main/Verification", {
mobile: this.tel
}).then(function(res) {
})
.then(function(res) {
window.console.log(res.data.data);
yz = res.data.data.yz;
t.yztoken=yz
t.ifsign=res.data.data.register
}).catch(function(error) {
t.yztoken = yz;
t.ifsign = res.data.data.register;
})
.catch(function(error) {
window.console.log(error);
});
} else {
window.console.log("请输入正确的手机号");
}
},
sub() {
let t = this;
window.console.log(t.ifsign,4859)
window.console.log(t.ifsign, 4859);
if (t.ifsign) {
if (t.tel && t.yzm) {
this.axios.post("http://lawpro.earnest.pro/api/Main/isVerification",{Verification: t.yzm,yz:this.yztoken, mobile:this.tel}).then((res)=>{
this.axios
.post("http://lawpro.earnest.pro/api/Main/isVerification", {
Verification: t.yzm,
yz: this.yztoken,
mobile: this.tel
})
.then(res => {
if (res.data.code == 200) {
this.axios.post("http://lawpro.earnest.pro/api/Main/sign",{yz:t.yztoken,Verification:t.yzm,mobile:this.tel}).then((res)=>{
window.console.log(res)
localStorage.setItem('token', res.data.data)
this.axios
.post("http://lawpro.earnest.pro/api/Main/sign", {
yz: t.yztoken,
Verification: t.yzm,
mobile: this.tel
})
.then(res => {
window.console.log(res);
localStorage.setItem("token", res.data.data);
this.$router.push({
path: `/index`,
})
})
path: `/index`
});
});
}
window.console.log(res)
}).catch((err)=>{
window.console.log(err)
window.console.log(res);
})
.catch(err => {
window.console.log(err);
});
}
} else {
this.$router.push({
path: `/sign?yztoken=`+t.yztoken+'&yzm='+t.yzm+'&tel='+t.tel,
})
path: `/sign?yztoken=` + t.yztoken + "&yzm=" + t.yzm + "&tel=" + t.tel
});
}
window.console.log( t.yztoken,t.Verification,9652)
window.console.log(t.yztoken, t.Verification, 9652);
}
}
};