XW hai 4 meses
pai
achega
9953a4750c
Modificáronse 1 ficheiros con 7 adicións e 8 borrados
  1. 7 8
      TEAMModelOS/ClientApp/src/view/joinSchool/qrcodeLogin.vue

+ 7 - 8
TEAMModelOS/ClientApp/src/view/joinSchool/qrcodeLogin.vue

@@ -7,12 +7,11 @@
         </span>
       </p>
       <div style="width:fit-content;margin: auto;" v-show="!isJoin">
-        <p style="font-size:16px;color:#fff">正在通过扫码登录
-          <span v-if="systemInfo.ip">{{ systemInfo.ip }}({{ systemInfo.region }})</span>
-        </p>
+        <p style="font-size:16px;color:#fff">正在通过扫码登录</p>
+        <p v-if="systemInfo.ip">{{ systemInfo.ip }}({{ systemInfo.region }})</p>
       </div>
 
-      <div class="join-btn" @click="toLogin()" v-show="!isJoin && !isRep">
+      <div class="join-btn" @click="joinList()" v-show="!isJoin && !isRep">
         立即登录
       </div>
 
@@ -34,6 +33,7 @@ export default {
       isLogin: false,
       isJoin: false,
       code: '',
+      randomcode: '',
       id_token: '',
       systemInfo: {
         ip: '',
@@ -50,7 +50,7 @@ export default {
     joinList() {
       this.$api.courseMgmt.qrcodeLogin({
         id_token: this.id_token,
-        randomcode: this.code,
+        randomcode: this.randomcode,
         ts: new Date().getTime()
       }).then(
         res => {
@@ -95,6 +95,7 @@ export default {
   },
   created() {
     console.log('当前站点配置信息', this.curSiteConfig)
+    this.randomcode = this.$route.query.randomcode  //登录成功返回的code
     this.code = this.$route.query.code  //登录成功返回的code
     if (this.code) {
       //获取登录信息
@@ -113,9 +114,7 @@ export default {
             localStorage.setItem("id_token", res.id_token)
             localStorage.setItem("expires_in", res.expires_in)
             let tokenData = jwtDecode(res.id_token)
-            if (tokenData) {
-              this.joinList()
-            } else {
+            if (!tokenData) {
               this.$Message.error(this.$t('cusMgt.join.parseErr'))
             }
           } else {