微信登录

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

View File

@ -11,7 +11,7 @@
</div>
<div class="tel yzm">
<input type="text" class="shuru tel1" placeholder="输入6位验证码" v-model="yzm"/>
<input type="text" class="shuru tel1" placeholder="输入6位验证码" v-model="yzm" />
<button class="getyzm" @click="yz">发送验证码</button>
</div>
<div class="ale">
@ -22,7 +22,7 @@
<!-- <div class="other">
<p @click="loginpwd">密码登录</p>
<p @click="open">需要帮助</p>
</div> -->
</div>-->
<div class="ways">
<div class="top">
<div class="line"></div>
@ -30,9 +30,24 @@
<div class="line"></div>
</div>
<div class="icons">
<img src="./assets/wechat.png" alt class="icon" />
<!-- <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" /> -->
<img src="./assets/qq.png" alt class="icon" />-->
</div>
</div>
<div class="tanchuangbox" v-if="ifshow">
@ -51,10 +66,10 @@ export default {
return {
ifshow: false,
tel: "",
yzm:"",
yztoken:"",
Verification:"",
ifsign:false
yzm: "",
yztoken: "",
Verification: "",
ifsign: false
};
},
methods: {
@ -64,58 +79,73 @@ export default {
off() {
this.ifshow = false;
},
loginpwd(){
this.$router.push({
path: `/loginpwd`,
})
loginpwd() {
this.$router.push({
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", {
mobile:this.tel
}).then(function(res) {
var t = this;
this.axios
.post("http://lawpro.earnest.pro/api/Main/Verification", {
mobile: this.tel
})
.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) {
yz = res.data.data.yz;
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)
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)=>{
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.$router.push({
path: `/index`,
})
sub() {
let t = this;
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
})
}
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,
})
.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.$router.push({
path: `/index`
});
});
}
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
});
}
window.console.log( t.yztoken,t.Verification,9652)
window.console.log(t.yztoken, t.Verification, 9652);
}
}
};
@ -191,7 +221,7 @@ export default {
justify-content: space-between;
}
.getyzm {
width: 176px!important;
width: 176px !important;
height: 54px;
border: 2px solid rgba(107, 145, 71, 1);
border-radius: 4px;