| | |
| | | * @Author: 小明丶 |
| | | * @Date: 2019-08-15 10:20:56 |
| | | * @LastEditors: zxq |
| | | * @LastEditTime: 2022-06-16 11:34:10 |
| | | * @LastEditTime: 2022-08-04 10:42:08 |
| | | * @Description: 登录页面 |
| | | --> |
| | | <template> |
| | |
| | | <div class="btn-box"> |
| | | <button @click="loginBut">登录</button> |
| | | </div> |
| | | <!-- <div class="idcard-box"> |
| | | <upLoadIdCard :cardBack="idCardMation.idBackUrl" :cardFont="idCardMation.idFrontUrl"></upLoadIdCard> |
| | | </div> --> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | if(sessionStorage.verCode){ |
| | | this.verCode = sessionStorage.verCode |
| | | } |
| | | |
| | | this.code = this.getUrlCode("code"); |
| | | console.log('this.code:',this.code) |
| | | console.log('this.$route.query.whichPage:',this.$route.query.whichPage) |
| | | if (this.code && !this.$route.query.whichPage) { |
| | | this.$api.wechatUserInfo({ code: this.code}).then(res => { |
| | | console.log('res.body.openid:',res.body.openid) |
| | | localStorage.edu_ins_client_openId = res.body.openid; |
| | | localStorage.edu_ins_client_userMation = JSON.stringify(res.body); |
| | | }); |
| | | } |
| | | }, |
| | | methods: { |
| | | ...mapActions(["login", "getVercode", "openIdLogin"]), |
| | | //截取code值 |
| | | getUrlCode(name) { |
| | | return ( |
| | | decodeURIComponent( |
| | | (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec( |
| | | location.href |
| | | ) || [, ""])[1].replace(/\+/g, "%20") |
| | | ) || null |
| | | ); |
| | | }, |
| | | ...mapActions(["login", "getVercode"]), |
| | | //登录验证 |
| | | loginBut() { |
| | | let v = this.$tool; |
| | |
| | | vm: this, |
| | | mblNo: this.mblNo, |
| | | verCode: this.verCode, |
| | | openId: localStorage.edu_ins_client_openId |
| | | // openId: localStorage.axx_ins_client_openId |
| | | }); |
| | | }, |
| | | sendCode() { |
| | |
| | | sessionStorage.beforeDate = new Date().getTime() |
| | | this.getSecond(60); |
| | | }) |
| | | // this.$store.dispatch("getVercode", { |
| | | // vm: this, |
| | | // mblNo: this.mblNo, |
| | | // verCodeType: 1 |
| | | // }); |
| | | |
| | | }, |
| | | //发送验证码计时函数 |
| | | getSecond(wait) { |
| | |
| | | |
| | | beforeRouteLeave (to, from, next) { |
| | | // ... |
| | | |
| | | clearTimeout(this.timer) |
| | | next() |
| | | } |