微信登录

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>
<div class="tel yzm"> <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> <button class="getyzm" @click="yz">发送验证码</button>
</div> </div>
<div class="ale"> <div class="ale">
@ -22,7 +22,7 @@
<!-- <div class="other"> <!-- <div class="other">
<p @click="loginpwd">密码登录</p> <p @click="loginpwd">密码登录</p>
<p @click="open">需要帮助</p> <p @click="open">需要帮助</p>
</div> --> </div>-->
<div class="ways"> <div class="ways">
<div class="top"> <div class="top">
<div class="line"></div> <div class="line"></div>
@ -30,9 +30,24 @@
<div class="line"></div> <div class="line"></div>
</div> </div>
<div class="icons"> <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/weibo.png" alt class="icon" />
<img src="./assets/qq.png" alt class="icon" /> --> <img src="./assets/qq.png" alt class="icon" />-->
</div> </div>
</div> </div>
<div class="tanchuangbox" v-if="ifshow"> <div class="tanchuangbox" v-if="ifshow">
@ -51,10 +66,10 @@ export default {
return { return {
ifshow: false, ifshow: false,
tel: "", tel: "",
yzm:"", yzm: "",
yztoken:"", yztoken: "",
Verification:"", Verification: "",
ifsign:false ifsign: false
}; };
}, },
methods: { methods: {
@ -64,58 +79,73 @@ export default {
off() { off() {
this.ifshow = false; this.ifshow = false;
}, },
loginpwd(){ loginpwd() {
this.$router.push({ this.$router.push({
path: `/loginpwd`, path: `/loginpwd`
}) });
}, },
yz() { yz() {
let yz="" let yz = "";
if (this.tel != "") { if (this.tel != "") {
window.console.log("aaaa"); window.console.log("aaaa");
var t =this var t = this;
this.axios.post("http://lawpro.earnest.pro/api/Main/Verification", { this.axios
mobile:this.tel .post("http://lawpro.earnest.pro/api/Main/Verification", {
}).then(function(res) { mobile: this.tel
})
.then(function(res) {
window.console.log(res.data.data); window.console.log(res.data.data);
yz=res.data.data.yz; yz = res.data.data.yz;
t.yztoken=yz t.yztoken = yz;
t.ifsign=res.data.data.register t.ifsign = res.data.data.register;
}).catch(function(error) { })
.catch(function(error) {
window.console.log(error); window.console.log(error);
}); });
} else { } else {
window.console.log("请输入正确的手机号"); window.console.log("请输入正确的手机号");
} }
}, },
sub(){ sub() {
let t=this; let t = this;
window.console.log(t.ifsign,4859) window.console.log(t.ifsign, 4859);
if(t.ifsign){ if (t.ifsign) {
if(t.tel&&t.yzm){ 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
if(res.data.code==200){ .post("http://lawpro.earnest.pro/api/Main/isVerification", {
this.axios.post("http://lawpro.earnest.pro/api/Main/sign",{yz:t.yztoken,Verification:t.yzm,mobile:this.tel}).then((res)=>{ Verification: t.yzm,
window.console.log(res) yz: this.yztoken,
localStorage.setItem('token', res.data.data) mobile: this.tel
this.$router.push({
path: `/index`,
})
}) })
} .then(res => {
window.console.log(res) if (res.data.code == 200) {
}).catch((err)=>{ this.axios
window.console.log(err) .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
});
} }
}else{
this.$router.push({ window.console.log(t.yztoken, t.Verification, 9652);
path: `/sign?yztoken=`+t.yztoken+'&yzm='+t.yzm+'&tel='+t.tel,
})
}
window.console.log( t.yztoken,t.Verification,9652)
} }
} }
}; };
@ -191,7 +221,7 @@ export default {
justify-content: space-between; justify-content: space-between;
} }
.getyzm { .getyzm {
width: 176px!important; width: 176px !important;
height: 54px; height: 54px;
border: 2px solid rgba(107, 145, 71, 1); border: 2px solid rgba(107, 145, 71, 1);
border-radius: 4px; border-radius: 4px;