zhangzengfei
2022-10-19 6339f41cfff5b9fdf33eb2f788658247430b5091
src/views/login/index.vue
@@ -1,11 +1,5 @@
<template>
  <div class="login-container">
    <el-alert
      title="beautiful boys and girls欢迎加入vue-admin-beautifulQQ群:972435319"
      type="success"
      :closable="false"
      style="position: fixed"
    ></el-alert>
    <el-row>
      <el-col :xs="24" :sm="24" :md="12" :lg="16" :xl="16">
        <div style="color: transparent">占位符</div>
@@ -18,11 +12,10 @@
          class="login-form"
          label-position="left"
        >
          <div class="title">hello !</div>
          <div class="title-tips">欢迎来到{{ title }}!</div>
          <div class="title-tips">欢迎使用{{ title }}!</div>
          <el-form-item style="margin-top: 40px" prop="username">
            <span class="svg-container svg-container-admin">
              <vab-icon :icon="['fas', 'user']" />
              <i class="el-icon-s-custom"></i>
            </span>
            <el-input
              v-model.trim="form.username"
@@ -34,7 +27,7 @@
          </el-form-item>
          <el-form-item prop="password">
            <span class="svg-container">
              <vab-icon :icon="['fas', 'lock']" />
              <i class="el-icon-lock"></i>
            </span>
            <el-input
              :key="passwordType"
@@ -50,10 +43,10 @@
              class="show-password"
              @click="handlePassword"
            >
              <vab-icon :icon="['fas', 'eye-slash']"></vab-icon>
              <i class="el-icon-view"></i>
            </span>
            <span v-else class="show-password" @click="handlePassword">
              <vab-icon :icon="['fas', 'eye']"></vab-icon>
              <i class="el-icon-view"></i>
            </span>
          </el-form-item>
          <el-button
@@ -64,9 +57,6 @@
          >
            登录
          </el-button>
          <router-link to="/register">
            <div style="margin-top: 20px">注册</div>
          </router-link>
        </el-form>
      </el-col>
    </el-row>
@@ -95,7 +85,7 @@
    };
    const validatePassword = (rule, value, callback) => {
      if (!isPassword(value)) {
        callback(new Error("密码不能少于6位"));
        callback(new Error("密码不能少于5位"));
      } else {
        callback();
      }
@@ -142,13 +132,6 @@
  beforeDestroy() {
    document.body.style.overflow = "auto";
  },
  mounted() {
    this.form.username = "admin";
    this.form.password = "123456";
    setTimeout(() => {
      this.handleLogin();
    }, 3000);
  },
  methods: {
    handlePassword() {
      this.passwordType === "password"
@@ -170,7 +153,7 @@
                  ? "/"
                  : this.redirect;
              this.$router.push(routerPath).catch(() => {});
              this.loading = false;
              this.loading = true;
            })
            .catch(() => {
              this.loading = false;