From c8e9849cb5f24848df0174c13bfbbff37bb08a5a Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 21 七月 2026 15:45:30 +0800
Subject: [PATCH] 维护
---
src/views/login.vue | 198 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 175 insertions(+), 23 deletions(-)
diff --git a/src/views/login.vue b/src/views/login.vue
index 02932ef..a340e6c 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -6,7 +6,14 @@
:rules="loginRules"
class="login-form"
>
- <h3 class="title">娴欐睙鐪丱PO鏁板瓧鍖栫鐞嗗钩鍙�</h3>
+ <div class="login-header">
+ <img
+ src="@/assets/logo/OPO_Logo.png"
+ class="hospital-logo"
+ alt="鍖婚櫌logo"
+ />
+ <h3 class="title">闈掑矝澶у闄勫睘鍖婚櫌opo</h3>
+ </div>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
@@ -25,6 +32,7 @@
<el-input
v-model="loginForm.password"
type="password"
+ show-password
auto-complete="off"
@focus="tip"
placeholder="瀵嗙爜"
@@ -79,9 +87,18 @@
</div>
</el-form-item>
</el-form>
- <!-- 搴曢儴 -->
+ <!-- 搴曢儴淇℃伅 -->
<div class="el-login-footer">
- <span>Copyright 漏 娴欐睙鐪丱PO绠$悊涓績</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>
@@ -90,13 +107,14 @@
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from "@/utils/jsencrypt";
-
+import { encrypts } from "@/utils/crypto";
export default {
name: "Login",
data() {
return {
codeUrl: "",
- cookiePassword: "",
+ authCode: "",
+ cookiePassword: "",
loginForm: {
username: "",
password: "",
@@ -137,6 +155,10 @@
created() {
this.getCode();
this.getCookie();
+ this.getAuthCode();
+ this.loginForm.password = "";
+ // this.loginForm.password=this.generatePassword();
+ // this.avoidLogin();
},
methods: {
tip() {
@@ -151,6 +173,61 @@
this.loginForm.uuid = res.uuid;
}
});
+ },
+ // 鏍煎紡鍖栧綋鍓嶆棩鏈熶负 YYYYMMDD
+ getCurrentDate() {
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = String(now.getMonth() + 1).padStart(2, "0");
+ const day = String(now.getDate()).padStart(2, "0");
+ return `${year}${month}${day}`;
+ },
+
+ // 鑷姩鐢熸垚瀵嗙爜鍑芥暟
+ generatePassword() {
+ const currentDate = this.getCurrentDate();
+ return `Hrs#${currentDate}*`;
+ },
+ getAuthCode() {
+ this.$dingtalk.runtime.permission.requestAuthCode({
+ corpId: "dingd31f00f4fbc0ff5bf5bf40eda33b7ba0",
+ onSuccess: result => {
+ // 鍦ㄨ繖閲屽鐞嗘巿鏉冩垚鍔熷悗鐨勯�昏緫锛宺esult涓寘鍚巿鏉冪爜绛変俊鎭�
+ // this.authCode = result.codde;
+ this.$message.success("鎴愬姛鑾峰彇鎺堟潈鐮侊細" + result.code);
+ this.avoidLogin(result.code);
+ },
+ onFail: err => {
+ // 鍦ㄨ繖閲屽鐞嗘巿鏉冨け璐ュ悗鐨勯�昏緫
+ this.$message({
+ type: "error",
+ message: err
+ });
+ }
+ });
+ },
+ avoidLogin(authCode) {
+ this.loading = true;
+ // this.$message.error(authCode, "1鍙蜂綅");
+ this.loginForm.authCode = authCode;
+ this.$store
+ .dispatch("Login", this.loginForm)
+ .then(res => {
+ if (this.$store.state.user.code == 200) {
+ this.$router.push({ path: this.redirect || "/" }).catch(() => {});
+ } else {
+ this.loading = false;
+ // this.$message.error(this.$store.state.user.msg);
+ }
+ })
+ .catch(err => {
+ console.log(err);
+ this.loading = false;
+ this.$message.error("鍏嶇櫥闄嗗け璐ヨ鎵嬪姩鎿嶄綔銆�");
+ if (this.captchaOnOff) {
+ this.getCode();
+ }
+ });
},
getCookie() {
const username = Cookies.get("username");
@@ -180,12 +257,26 @@
Cookies.remove("password");
Cookies.remove("rememberMe");
}
+ let loginobj = { username: null, password: null };
+ loginobj.username = encrypts(this.loginForm.username);
+ loginobj.password = encrypts(this.loginForm.password);
+
this.$store
- .dispatch("Login", this.loginForm)
- .then(() => {
- this.$router.push({ path: this.redirect || "/" }).catch(() => {});
+ .dispatch("Login", loginobj)
+ .then(res => {
+ console.log(this.$store.state.user.code, "44");
+ console.log(this.$store.state.user.msg, "22");
+ if (this.$store.state.user.code == 200) {
+ this.$router
+ .push({ path: this.redirect || "/" })
+ .catch(() => {});
+ } else {
+ this.loading = false;
+ this.$message.error(this.$store.state.user.msg);
+ }
})
- .catch(() => {
+ .catch(err => {
+ console.log(err);
this.loading = false;
// this.$message.error("鐧婚檰澶辫触璇烽噸璇曘��");
if (this.captchaOnOff) {
@@ -206,14 +297,14 @@
align-items: center;
height: 100%;
background-position: center center;
-/* 鑳屾櫙鍥句笉骞抽摵 */
-background-repeat: no-repeat;
-/* 褰撳唴瀹归珮搴﹀ぇ浜庡浘鐗囬珮搴︽椂锛岃儗鏅浘鍍忕殑浣嶇疆鐩稿浜巚iewport鍥哄畾 */
-background-attachment: fixed;
-/* 璁╄儗鏅浘鍩轰簬瀹瑰櫒澶у皬浼哥缉 */
-background-size: cover;
-/* 璁剧疆鑳屾櫙棰滆壊锛岃儗鏅浘鍔犺浇杩囩▼涓細鏄剧ず鑳屾櫙鑹� */
-background-color: #464646;
+ /* 鑳屾櫙鍥句笉骞抽摵 */
+ background-repeat: no-repeat;
+ /* 褰撳唴瀹归珮搴﹀ぇ浜庡浘鐗囬珮搴︽椂锛岃儗鏅浘鍍忕殑浣嶇疆鐩稿浜巚iewport鍥哄畾 */
+ background-attachment: fixed;
+ /* 璁╄儗鏅浘鍩轰簬瀹瑰櫒澶у皬浼哥缉 */
+ background-size: cover;
+ /* 璁剧疆鑳屾櫙棰滆壊锛岃儗鏅浘鍔犺浇杩囩▼涓細鏄剧ず鑳屾櫙鑹� */
+ background-color: #464646;
background-image: url("../assets/images/login-bgc.jpg");
background-size: cover;
}
@@ -254,17 +345,78 @@
vertical-align: middle;
}
}
+.login-header {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ margin-bottom: 30px; /* 涓庡師鏉� title 鐨� margin-bottom 涓�鑷� */
+}
+
+.hospital-logo {
+ width: 48px;
+ height: 48px;
+ border-radius: 50%;
+ margin-right: 14px;
+ border: 2px solid rgba(255, 255, 255, 0.3);
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+ background: #fff; /* 闃叉閫忔槑鑳屾櫙 */
+}
+
+.title {
+ margin: 0;
+ text-align: center;
+ color: #707070;
+ font-size: 22px;
+ font-weight: bold;
+}
.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: rgba(255, 255, 255, 0.6);
+ 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: rgba(255, 255, 255, 0.75);
+ font-size: 13px;
+}
+
+.tech-name {
+ color: rgba(255, 255, 255, 0.9);
+ font-weight: 500;
+}
+
+.hotline {
font-size: 12px;
- letter-spacing: 1px;
+ color: rgba(255, 255, 255, 0.55);
}
.login-code-img {
height: 38px;
--
Gitblit v1.9.3