From cb74707f3a8d61a884343c57e63f9cfdaf7434b1 Mon Sep 17 00:00:00 2001
From: zhaoxiaoqiang <287285524@qq.com>
Date: Tue, 11 Oct 2022 17:44:19 +0800
Subject: [PATCH] this.isClickSend

---
 src/views/user/login.vue |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/src/views/user/login.vue b/src/views/user/login.vue
index ae7a3d3..c944dcf 100644
--- a/src/views/user/login.vue
+++ b/src/views/user/login.vue
@@ -2,7 +2,7 @@
  * @Author: 小明丶
  * @Date: 2019-08-15 10:20:56
  * @LastEditors: zxq
- * @LastEditTime: 2022-08-04 10:42:08
+ * @LastEditTime: 2022-08-12 10:08:15
  * @Description: 登录页面
  -->
 <template>
@@ -11,7 +11,7 @@
       <div class="logo-img-box">
         <img src="../../../static/img/logo.png" alt="logo" class="logo-pic" />
       </div>
-      <p>爱享学</p>
+      <p>好学付</p>
     </div>
     <h-ipt
       icon="iconxingming"
@@ -108,9 +108,30 @@
     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.axx_ins_client_openId = res.body.openid;
+          localStorage.axx_ins_client_userMation = JSON.stringify(res.body);
+      });
+    }
   },
   methods: {
-    ...mapActions(["login", "getVercode"]),
+    ...mapActions(["login", "getVercode", "openIdLogin"]),
+    //截取code值
+    getUrlCode(name) {
+      return (
+        decodeURIComponent(
+          (new RegExp("[?|&]" + name + "=" + "([^&;]+?)(&|#|;|$)").exec(
+            location.href
+          ) || [, ""])[1].replace(/\+/g, "%20")
+        ) || null
+      );
+    },
     //登录验证
     loginBut() {
       let v = this.$tool;
@@ -134,7 +155,6 @@
         vm: this,
         mblNo: this.mblNo,
         verCode: this.verCode,
-        // openId: localStorage.axx_ins_client_openId
       });
     },
     sendCode() {
@@ -154,6 +174,12 @@
         sessionStorage.beforeDate = new Date().getTime()
         this.getSecond(60);
       })
+      // this.$store.dispatch("getVercode", {
+      //   vm: this,
+      //   mblNo: this.mblNo,
+      //   verCodeType: 1
+      // });
+     
     },
     //发送验证码计时函数
     getSecond(wait) {
@@ -202,6 +228,7 @@
   
   beforeRouteLeave (to, from, next) {
     // ...
+    
     clearTimeout(this.timer)
     next()
   }

--
Gitblit v1.8.0