From 39c8b288ec8294e026459dfb1955f0bbc49ebb52 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 19 十月 2026 11:10:40 +0800
Subject: [PATCH] 测试完成
---
src/views/login.vue | 38 ++++++++++++++++++++++++++++++++++----
1 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/src/views/login.vue b/src/views/login.vue
index 10cf9d3..c166a26 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -13,6 +13,7 @@
type="text"
auto-complete="off"
placeholder="璐﹀彿"
+ @blur="handleUsernameBlur"
>
<svg-icon
slot="prefix"
@@ -154,6 +155,7 @@
immediate: true,
},
},
+
created() {
this.getorganization();
this.getCode();
@@ -161,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() {
@@ -183,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");
@@ -237,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();
@@ -252,6 +281,7 @@
}
});
},
+
},
};
</script>
@@ -321,7 +351,7 @@
width: 100%;
text-align: center;
font-size: 13px;
- color: #3664D9;
+ color: #3664d9;
z-index: 10;
}
@@ -349,18 +379,18 @@
.tech-label,
.tech-name,
.hotline {
- color: #3664D9;;
+ color: #3664d9;
font-size: 13px;
}
.tech-name {
- color: #3664D9;;
+ color: #3664d9;
font-weight: 500;
}
.hotline {
font-size: 12px;
- color: #3664D9;;
+ color: #3664d9;
}
.login-code-img {
height: 38px;
--
Gitblit v1.9.3