From 020d40734a2062300d8b1651a1688fc987590c0a Mon Sep 17 00:00:00 2001
From: litian <2804272236@qq.com>
Date: 星期五, 22 十一月 2024 15:00:12 +0800
Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/TextbookReader

---
 src/views/login.vue |   83 ++++++++++++++++++++++-------------------
 1 files changed, 44 insertions(+), 39 deletions(-)

diff --git a/src/views/login.vue b/src/views/login.vue
index 302d11f..2bf055d 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -8,19 +8,19 @@
             <el-form-item prop="username">
               <!-- <el-input v-model="loginData.username"></el-input> -->
               <el-input v-model="loginData.username" placeholder="璇疯緭鍏ユ墜鏈哄彿" size="large">
-              <template #prepend>
-                <el-select
-                  v-model="select"
-                  placeholder="Select"
-                  class="selectPhone"
-                >
-                  <el-option label="涓浗+86" value="86" />
-                </el-select>
-              </template>
-            </el-input>
+                <template #prepend>
+                  <el-select v-model="select" placeholder="Select" class="selectPhone">
+                    <el-option label="涓浗+86" value="86" />
+                  </el-select>
+                </template>
+              </el-input>
             </el-form-item>
             <el-form-item prop="password">
-              <el-input type="password" v-model="loginData.password" placeholder="璇疯緭鍏ュ瘑鐮�"></el-input>
+              <el-input
+                type="password"
+                v-model="loginData.password"
+                placeholder="璇疯緭鍏ュ瘑鐮�"
+              ></el-input>
             </el-form-item>
             <div class="btnBox">
               <el-button
@@ -82,7 +82,10 @@
             if (route.query.redirect) {
               router.push(route.query.redirect)
             } else {
-              router.push('/home')
+              router.replace({
+                path: '/home',
+                query: { bookId: localStorage.getItem('bookId') }
+              })
             }
           } else if (res.data.isError) {
             ElMessage.error(res.data.errorDescription)
@@ -106,13 +109,9 @@
       let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone')
       let nameAndPassword = res.secretList.find((item) => item.type == 'LoginNameAndPassword')
 
-      if (nameAndPassword) {
+     if (teacherRole && teacherInfos) {
         let userInfo = {
-          name: nameAndPassword.credential
-        }
-        localStorage.setItem('userInfo', JSON.stringify(userInfo))
-      } else if (teacherRole && teacherInfos) {
-        let userInfo = {
+          ...teacherInfos,
           name: teacherInfos.name,
           role: 'Teacher',
           roleId: teacherRole.role.id
@@ -120,6 +119,7 @@
         localStorage.setItem('userInfo', JSON.stringify(userInfo))
       } else if (phoneInfo) {
         let userInfo = {
+          ...phoneInfo,
           name: phoneInfo.credential
         }
         localStorage.setItem('userInfo', JSON.stringify(userInfo))
@@ -141,13 +141,13 @@
     width: 800px;
     height: 540px;
     border-radius: 20px;
-    overflow:hidden;
+    overflow: hidden;
     display: flex;
-    background: #FFFFFF;
-    box-shadow: 0px 6px 9px 1px rgba(0,0,0,0.06);
+    background: #ffffff;
+    box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.1);
     .loginForm {
       width: 410px;
-      padding:40px;
+      padding: 40px;
       height: 100%;
       display: flex;
       flex-direction: column;
@@ -177,30 +177,35 @@
       box-sizing: border-box;
       width: 403px;
     }
-    .el-input{
+    .el-input {
       height: 40px;
     }
     .el-select {
-        width: 100px;
-        height: 40px;
-        .el-select__wrapper {
+      width: 100px;
+      height: 40px;
+      .el-select__wrapper {
+        height: 100% !important;
+        .el-input--suffix {
           height: 100% !important;
-          .el-input--suffix {
-            height: 100% !important;
-            background-color: #fff;
-          }
+          background-color: #fff;
         }
       }
+    }
 
-      .logInBtn {
-        width: 304px;
-        height: 40px;
-        margin-top: 10px;
-        margin-bottom: 20px;
-        border-radius: 3px;
-        color: #fff;
-        font-size: 14px;
-      }
+    .logInBtn {
+      width: 304px;
+      height: 40px;
+      margin-top: 10px;
+      margin-bottom: 20px;
+      border-radius: 3px;
+      color: #fff;
+      font-size: 14px;
+    }
+  }
+}
+@media screen and (max-width: 450px) {
+  .rightImg {
+    display: none;
   }
 }
 </style>

--
Gitblit v1.9.1