qx
9 天以前 38a40fefc0c7c6afb17958f6827304dbefda9873
src/views/login.vue
@@ -1,7 +1,7 @@
<template>
  <div class="login">
    <!-- <div style="padding-top: 130px;"> -->
      <div style="font-weight: 700;font-size: 50px;">智能健康体检管理系统</div>
    <div style="font-weight: 700;font-size: 50px;">智能健康体检管理系统</div>
    <!-- </div> -->
@@ -58,13 +58,14 @@
    <!--  底部  -->
    <div class="el-login-footer">
      <span>Copyright © 2023-2024 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 Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
@@ -78,6 +79,7 @@
        username: "",
        password: "",
        mobile: false,
        hospId: "",
        // username:"13800138008",
        // password:"888888",
        rememberMe: false,
@@ -136,6 +138,7 @@
  created() {
    this.getstate();
    this.getCookie();
    this.loadAll();
  },
  methods: {
    getstate() {
@@ -148,6 +151,69 @@
        }
      })
    },
    loadAll() {
      const env = process.env.VUE_APP_ENV
      if (env === 'development') {
        this.loginForm.hospId = this.$route.query.hospId
        Cookies.set("hospId", this.loginForm.hospId);
      } else if (env === 'production') {
        // 获取当前URL的端口号
        const port = window.location.port;
        switch (port) {
          case '8094':
            this.loginForm.hospId = "pbkwyy";
            break;
          case '8095':
            this.loginForm.hospId = "jdczgzyy";
            break;
          case '8096':
            this.loginForm.hospId = "sqyy";
            break;
          case '8097':
            this.loginForm.hospId = "wbzxyy";
            break;
          case '8098':
            this.loginForm.hospId = "bjxjyy";
            break;
            case '8099':
            this.loginForm.hospId = "bjfhyy";
            break;
        }
        Cookies.set("hospId", this.loginForm.hospId);
      } else if (env === 'staging') {
        // 获取当前URL的端口号
        const port = window.location.port;
        switch (port) {
          case '9013':
            this.loginForm.hospId = "pbkwyy";
            break;
          case '9014':
            this.loginForm.hospId = "jdczgzyy";
            break;
          case '9015':
            this.loginForm.hospId = "sqyy";
            break;
          case '9016':
            this.loginForm.hospId = "wbzxyy";
            break;
          case '9017':
            this.loginForm.hospId = "bjxjyy";
            break;
        }
        Cookies.set("hospId", this.loginForm.hospId);
      }
      // 存储hospId到Cookie
      // 更新URL参数
      if (this.loginForm.hospId) {
        const query = { ...this.$route.query, hospId: this.loginForm.hospId };
        this.$router.replace({ query });
      }
    },
    hide() {
@@ -233,6 +299,7 @@
                }
              }
              this.$router.push({ path: this.redirect || "/" }).catch(() => { });
              location.reload();
            }
          }).catch(() => {