wwl
2025-02-15 5b4e348267b5541d54fffcc75c7b307ad514a692
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,42 @@
      })
    },
    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 '9011':
            this.loginForm.hospId = "chkwyy";
            break;
          case '9012':
            this.loginForm.hospId = "xamjyy";
            break;
          case '8094':
            this.loginForm.hospId = "pbkwyy";
            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() {