qx
2025-03-26 155a30a172e4cf04838dcf7c8bb73ce6b200e574
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> -->
@@ -78,7 +78,7 @@
        username: "",
        password: "",
        mobile: false,
        hospId:"",
        hospId: "",
        // username:"13800138008",
        // password:"888888",
        rememberMe: false,
@@ -151,9 +151,67 @@
      })
    },
    loadAll(){
      this.loginForm.hospId = this.$route.query.hospId
      Cookies.set("hospId", this.loginForm.hospId);
    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 '9011':
            this.loginForm.hospId = "chkwyy";
            break;
          case '9012':
            this.loginForm.hospId = "xamjyy";
            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;
        }
        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() {