liusheng
2 天以前 bbbc478129f72b26e2ec4a2e981ed8698a96880c
src/views/login.vue
@@ -1,5 +1,3 @@
<template>
  <div class="login">
    <el-form
@@ -15,6 +13,7 @@
          type="text"
          auto-complete="off"
          placeholder="账号"
          @blur="handleUsernameBlur"
        >
          <svg-icon
            slot="prefix"
@@ -27,6 +26,7 @@
        <el-input
          v-model="loginForm.password"
          type="password"
          show-password
          auto-complete="off"
          placeholder="密码"
          @keyup.enter.native="handleLogin"
@@ -95,10 +95,19 @@
        </div>
      </el-form-item>
    </el-form>
    <!--  底部  -->
    <!-- <div class="el-login-footer">
      <span style="color: #568FBD; font-size: 25px;">Copyright © 2018-2022 ruoyi.vip All Rights Reserved.</span>
    </div> -->
    <!-- 底部信息 -->
    <div class="el-login-footer">
      <div class="footer-content">
        <div class="footer-row">
          <span class="tech-label">技术支持:</span>
          <img src="@/assets/logo/Hrs.png" class="tech-logo" alt="logo" />
          <span class="tech-name">浙江亥尔时科技有限公司</span>
        </div>
        <div class="footer-row">
          <span class="hotline">服务热线:17778760073</span>
        </div>
      </div>
    </div>
  </div>
</template>
@@ -128,7 +137,7 @@
        password: [
          { required: true, trigger: "blur", message: "请输入您的密码" },
        ],
        orgid: [{ required: true, trigger: "blur", message: "请选择院区" }],
        campusid: [{ required: true, trigger: "blur", message: "请选择院区" }],
      },
      loading: false,
      // 验证码开关
@@ -146,6 +155,7 @@
      immediate: true,
    },
  },
  created() {
    this.getorganization();
    this.getCode();
@@ -153,6 +163,12 @@
    // if (localStorage.getItem('orgid')) {
    //   this.loginForm.orgid = localStorage.getItem('orgid');
    // }
  },
    computed: {
    isAdmin() {
      const roles = this.$store.getters.roles || [];
      return roles.includes("mydstaff");
    }
  },
  methods: {
    getCode() {
@@ -175,6 +191,17 @@
          }));
        }
      });
    },
    // 输入完账号后,检索可选机构是否包含“南华附一”,若有则自动填充密码
    handleUsernameBlur() {
      if (!this.loginForm.username) return;
      const hasNanhua = this.options.some((item) => {
        const label = item.label || "";
        return label.includes("南华") && label.includes("附一");
      });
      if (hasNanhua) {
        this.loginForm.password = "nhfy@0230";
      }
    },
    getCookie() {
      const username = Cookies.get("username");
@@ -212,7 +239,7 @@
          );
          this.loginForm.campusid = selectedOrg.campusid || 1;
          this.loginForm.orgid = selectedOrg.value || 1;
          this.loginForm.orgname = selectedOrg.label || '';
          this.loginForm.orgname = selectedOrg.label || "";
          // 市一处理-----------------
          // if (selectedOrg) {
          //   if (selectedOrg.label.includes("湖滨")) {
@@ -229,13 +256,23 @@
            .then((res) => {
              if (this.loginForm.username == "admin") {
                this.$router.push({ path: "/index" }).catch(() => {});
              } else if (this.isAdmin) {
                console.log(1);
                 this.$router
                  .push({ path: "/Intelligentcenter/dispose" })
                  .catch(() => {});
              } else {
                console.log(2);
                this.$router
                  .push({ path: "/followvisit/discharge" })
                  .catch(() => {});
              }
            })
            .catch(() => {
              console.log(3);
              this.loading = false;
              if (this.captchaEnabled) {
                this.getCode();
@@ -244,6 +281,7 @@
        }
      });
    },
  },
};
</script>
@@ -306,18 +344,54 @@
  }
}
.el-login-footer {
  height: 40px;
  line-height: 40px;
  position: fixed;
  bottom: 0;
  bottom: 20px;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  color: #fff;
  font-family: Arial;
  font-size: 12px;
  letter-spacing: 1px;
  font-size: 13px;
  color: #3664d9;
  z-index: 10;
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tech-logo {
  width: 28px;
  height: 28px;
  margin: 0 6px;
  vertical-align: middle;
}
.tech-label,
.tech-name,
.hotline {
  color: #3664d9;
  font-size: 13px;
}
.tech-name {
  color: #3664d9;
  font-weight: 500;
}
.hotline {
  font-size: 12px;
  color: #3664d9;
}
.login-code-img {
  height: 38px;
}