闫增涛
2024-07-04 1a6896dd660024b4ca2605a809f0f285f19929f0
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>