From c2486044121750d274d40aac2e65b47d4c25b5c9 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期一, 22 四月 2024 18:08:15 +0800 Subject: [PATCH] 11 --- src/views/login.vue | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/views/login.vue b/src/views/login.vue index 40d3760..df7a011 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -120,7 +120,7 @@ }, loading: false, // 楠岃瘉鐮佸紑鍏� - captchaOnOff: false, + captchaOnOff: true, // 娉ㄥ唽寮�鍏� register: false, redirect: undefined @@ -182,12 +182,22 @@ } this.$store .dispatch("Login", this.loginForm) - .then(() => { - this.$router.push({ path: this.redirect || "/" }).catch(() => {}); - }) - .catch(() => { + .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.$message.error(this.$store.state.user.msg); + } + }) + .catch(err => { + console.log(err); + this.loading = false; + // this.$message.error("鐧婚檰澶辫触璇烽噸璇曘��"); if (this.captchaOnOff) { this.getCode(); } @@ -205,6 +215,15 @@ justify-content: center; align-items: center; height: 100%; + background-position: center center; + /* 鑳屾櫙鍥句笉骞抽摵 */ + 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; } -- Gitblit v1.9.3