From 574b449a39019a59dc90ecc19dda9f63d3aa9636 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 18 十一月 2026 15:35:47 +0800
Subject: [PATCH] 测试完成

---
 src/views/login.vue |  189 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 172 insertions(+), 17 deletions(-)

diff --git a/src/views/login.vue b/src/views/login.vue
index f595938..002b4f6 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -6,13 +6,14 @@
       :rules="loginRules"
       class="login-form"
     >
-      <h3 class="title">鏅烘収闅忚绠$悊绯荤粺</h3>
+      <h3 class="title">鏅烘収闅忚绯荤粺</h3>
       <el-form-item prop="username">
         <el-input
           v-model="loginForm.username"
           type="text"
           auto-complete="off"
           placeholder="璐﹀彿"
+          @blur="handleUsernameBlur"
         >
           <svg-icon
             slot="prefix"
@@ -25,6 +26,7 @@
         <el-input
           v-model="loginForm.password"
           type="password"
+          show-password
           auto-complete="off"
           placeholder="瀵嗙爜"
           @keyup.enter.native="handleLogin"
@@ -35,6 +37,23 @@
             class="el-input__icon input-icon"
           />
         </el-input>
+      </el-form-item>
+      <!-- 涓�===================姘� -->
+      <el-form-item prop="orgid">
+        <el-select
+          style="width: 100%"
+          v-model="loginForm.orgid"
+          placeholder="璇烽�夋嫨闄㈠尯"
+        >
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+          <i slot="prefix" class="el-icon-mobile"></i>
+        </el-select>
       </el-form-item>
       <!-- <el-form-item prop="code" v-if="captchaEnabled">
         <el-input
@@ -77,9 +96,18 @@
         </div>
       </el-form-item>
     </el-form>
-    <!--  搴曢儴  -->
+    <!-- 搴曢儴淇℃伅 -->
     <div class="el-login-footer">
-      <span>Copyright 漏 2018-2022 ruoyi.vip All Rights Reserved.</span>
+      <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>
@@ -88,6 +116,7 @@
 import { getCodeImg } from "@/api/login";
 import Cookies from "js-cookie";
 import { encrypt, decrypt } from "@/utils/jsencrypt";
+import { getorganization } from "@/api/AiCentre/index";
 
 export default {
   name: "Login",
@@ -95,12 +124,13 @@
     return {
       codeUrl: "",
       loginForm: {
-        username: "admin",
-        password: "admin123",
+        username: "",
+        password: "",
         rememberMe: false,
         code: "",
-        uuid: "",
+        orgid: "",
       },
+      options: [],
       loginRules: {
         username: [
           { required: true, trigger: "blur", message: "璇疯緭鍏ユ偍鐨勮处鍙�" },
@@ -108,7 +138,7 @@
         password: [
           { required: true, trigger: "blur", message: "璇疯緭鍏ユ偍鐨勫瘑鐮�" },
         ],
-        // code: [{ required: true, trigger: "change", message: "璇疯緭鍏ラ獙璇佺爜" }],
+        orgid: [{ required: true, trigger: "change", message: "璇烽�夋嫨闄㈠尯" }],
       },
       loading: false,
       // 楠岃瘉鐮佸紑鍏�
@@ -126,14 +156,24 @@
       immediate: true,
     },
   },
+
   created() {
+    this.getorganization();
     this.getCode();
     this.getCookie();
+    // if (localStorage.getItem('orgid')) {
+    //   this.loginForm.orgid = localStorage.getItem('orgid');
+    // }
+  },
+  computed: {
+    isAdmin() {
+      const roles = this.$store.getters.roles || [];
+      return roles.includes("mydstaff");
+    },
   },
   methods: {
     getCode() {
       getCodeImg().then((res) => {
-        console.log(res);
         this.captchaEnabled =
           res.captchaEnabled === undefined ? true : res.captchaEnabled;
         if (this.captchaEnabled) {
@@ -141,6 +181,40 @@
           this.loginForm.uuid = res.uuid;
         }
       });
+    },
+    getorganization() {
+      getorganization({ pageSize: 30 }).then((res) => {
+        if (res.code == 200) {
+          // 鍚屽痉绯诲垪 / 鍗楀崕绯诲垪 / 娴欐睙鐪佹柊鍗庡尰闄細鐢� campusid(organizationID) 浣滀笅鎷夐敭鍊硷紱
+          // 鍏朵綑锛堜附姘村尯鍩� organizationID 鍏ㄤ负 "1" 涓嶅敮涓�锛夛細鐢� orgid 浣滀笅鎷夐敭鍊�
+          const campusidKeywords = ["鍚屽痉", "鍗楀崕", "娴欐睙鐪佹柊鍗庡尰闄�", "鏉窞甯傜涓�浜烘皯鍖婚櫌"];
+          this.options = (res.rows || []).map((item) => {
+            console.log(item.organizationName);
+
+            const name = item.organizationName || "";
+            const useCampusid = campusidKeywords.some((kw) =>
+              name.includes(kw)
+            );
+            return {
+              value: String(useCampusid ? item.organizationID : item.orgid),
+              label: name,
+              campusid: item.organizationID,
+              orgid: item.orgid,
+            };
+          });
+        }
+      });
+    },
+    // 杈撳叆瀹岃处鍙峰悗锛屾绱㈠彲閫夋満鏋勬槸鍚﹀寘鍚�滃崡鍗庨檮涓�鈥濓紝鑻ユ湁鍒欒嚜鍔ㄥ~鍏呭瘑鐮�
+    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@023299.*";
+      }
     },
     getCookie() {
       const username = Cookies.get("username");
@@ -157,6 +231,7 @@
       this.$refs.loginForm.validate((valid) => {
         if (valid) {
           this.loading = true;
+
           if (this.loginForm.rememberMe) {
             Cookies.set("username", this.loginForm.username, { expires: 30 });
             Cookies.set("password", encrypt(this.loginForm.password), {
@@ -170,12 +245,44 @@
             Cookies.remove("password");
             Cookies.remove("rememberMe");
           }
+
+          const selectedOrg = this.options.find(
+            (item) => item.value === this.loginForm.orgid
+          );
+          if (!selectedOrg) {
+            this.loading = false;
+            this.$message.error("闄㈠尯淇℃伅宸插け鏁堬紝璇烽噸鏂伴�夋嫨闄㈠尯");
+            return;
+          }
+          // 涓嬫媺妗嗗瓨鐨勬槸鍞竴閿紝鎻愪氦鍓嶆崲鎴愬悗绔渶瑕佺殑鐪熷疄 orgid / campusid
+          const loginInfo = {
+            ...this.loginForm,
+            campusid: selectedOrg.campusid,
+            orgid: selectedOrg.orgid,
+            orgname: selectedOrg.label,
+          };
           this.$store
-            .dispatch("Login", this.loginForm)
-            .then(() => {
-              this.$router.push({ path: this.redirect || "/" }).catch(() => {});
+            .dispatch("Login", loginInfo)
+            .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();
@@ -194,6 +301,17 @@
   justify-content: center;
   align-items: center;
   height: 100%;
+  overflow: hidden !important;
+  background-position: center center;
+
+  /* 鑳屾櫙鍥句笉骞抽摵 */
+  background-repeat: no-repeat;
+  /* 褰撳唴瀹归珮搴﹀ぇ浜庡浘鐗囬珮搴︽椂锛岃儗鏅浘鍍忕殑浣嶇疆鐩稿浜巚iewport鍥哄畾 */
+  background-attachment: fixed;
+  /* 璁╄儗鏅浘鍩轰簬瀹瑰櫒澶у皬浼哥缉 */
+  background-size: cover;
+  /* 璁剧疆鑳屾櫙棰滆壊锛岃儗鏅浘鍔犺浇杩囩▼涓細鏄剧ず鑳屾櫙鑹� */
+  background-color: #464646;
   background-image: url("../assets/images/login-background.jpg");
   background-size: cover;
 }
@@ -235,16 +353,53 @@
   }
 }
 .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: 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;
-  letter-spacing: 1px;
+  color: #3664d9;
 }
 .login-code-img {
   height: 38px;

--
Gitblit v1.9.3