qinxianzhangyao
2023-10-17 ba9dbeee7c139c67d770afe0053f06f1f235e565
src/views/login.vue
@@ -1,6 +1,10 @@
<template>
  <div class="login">
    <h1>智能健康体检管理系统</h1>
    <!-- <div style="padding-top: 130px;"> -->
      <h2>兴平兴化社区服务站</h2>
      <h1>智能健康体检管理系统</h1>
    <!-- </div> -->
    <el-form :inline="true" ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
      <div class="img">
@@ -61,7 +65,7 @@
</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'
@@ -97,7 +101,7 @@
      openeye: require('../assets/images/by.png'),
      flag: false,
      loading: false,
      configKey:"captcha_switch",
      configKey: "captcha_switch",
      // // 验证码开关
      captchaEnabled: true,
      // 注册开关
@@ -134,18 +138,18 @@
    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";
@@ -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(() => { });
            }