qx
qx
2025-04-21 585a80894b9249878fee9c7182f4d14f8e5da985
src/views/login.vue
@@ -1,6 +1,9 @@
<template>
  <div class="login">
    <h1>智能健康体检管理系统</h1>
    <!-- <div style="padding-top: 130px;"> -->
      <div style="font-weight: 700;font-size: 50px;">智能健康体检管理系统</div>
    <!-- </div> -->
    <el-form :inline="true" ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
      <div class="img">
@@ -55,13 +58,14 @@
    <!--  底部  -->
    <div class="el-login-footer">
      <span>Copyright © 2022-2023龙美网络 All Rights Reserved.</span>
      <span>Copyright © 2024-2025 All Rights Reserved.</span>
      <!-- <span>Copyright © 2022-2023龙美网络 All Rights Reserved.</span> -->
    </div>
  </div>
</template>
<script>
import { getCodeImg ,getconfigKey} from "@/api/login";
import { getCodeImg, getconfigKey } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
@@ -83,21 +87,21 @@
      },
      loginRules: {
        username: [
          { required: true, trigger: "blur", message: "请输入您的账号" }
          { required: true, trigger: "blur", message: "" }
        ],
        password: [
          { required: true, trigger: "blur", message: "请输入您的密码" }
          { required: true, trigger: "blur", message: "" }
        ],
        code: [{ required: true, trigger: "change", message: "请输入验证码" }],
        code: [{ required: true, trigger: "change", message: "" }],
        mobile: [
          { required: true, trigger: "change", message: "请选择" }
          { required: true, trigger: "change", message: "" }
        ]
      },
      pwdtype: 'password',
      openeye: require('../assets/images/by.png'),
      flag: false,
      loading: false,
      configKey:"captcha_switch",
      configKey: "captcha_switch",
      // // 验证码开关
      captchaEnabled: true,
      // 注册开关
@@ -134,21 +138,21 @@
    this.getCookie();
  },
  methods: {
    getstate(){
    getstate() {
      getconfigKey().then(res => {
        if(res.msg == "Y"){
        if (res.msg == "Y") {
          this.captchaEnabled = true
          this.getCode();
        }else if(res.msg == "N"){
        } else if (res.msg == "N") {
          this.captchaEnabled = false
        }
      })
    },
    hide() {
      this.loginForm.username = "10001";
      this.loginForm.password = "admin123";
      // this.loginForm.username = "10001";
      // this.loginForm.password = "admin123";
    },
    changetype() {
      this.pwdtype = this.pwdtype === 'password' ? 'text' : 'password'
@@ -181,7 +185,7 @@
      }
    },
    handleLogin() {
      if (this.loginForm.username.length < 6) {
      if (this.loginForm.username.length < 12) {
        this.loginForm.mobile = true;
        this.$router.push({ path: this.redirect || "/" }).catch(() => { });
      } else {
@@ -218,6 +222,16 @@
              });
            } else {
              const securitMessage = JSON.parse(localStorage.getItem("securitMessage"));
              if (securitMessage) {
                if (securitMessage != null) {
                  this.$message({
                    message: securitMessage,
                    type: 'success'
                  });
                  localStorage.removeItem("securitMessage");
                }
              }
              this.$router.push({ path: this.redirect || "/" }).catch(() => { });
            }
@@ -238,13 +252,14 @@
<style rel="stylesheet/scss" lang="scss">
.login {
  display: flex;
  justify-content: center;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: 100%;
  // background-image: url("../assets/images/login-background.jpg");
  background-size: cover;
  flex-direction: column;
  margin-top: 170px;
}
.card {