From 5e1038cf23c4f60fcb118de49064f8db73964286 Mon Sep 17 00:00:00 2001 From: asd Date: Fri, 29 Nov 2019 10:36:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/login.vue | 126 +++++++++++++++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 48 deletions(-) diff --git a/src/login.vue b/src/login.vue index 2646384..864f2ad 100644 --- a/src/login.vue +++ b/src/login.vue @@ -11,7 +11,7 @@
- +
@@ -22,7 +22,7 @@ +
-->
@@ -30,9 +30,24 @@
- + + +
+ + + + + +
+ + -->
@@ -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) - }) + .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 + }); } - }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;