From 94e9b54ed5f2ce4641db89007b4252b03925b17e Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 23 四月 2024 09:51:56 +0800
Subject: [PATCH] 11

---
 src/views/login.vue |   34 ++++++++++++++++++++++------------
 1 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/src/views/login.vue b/src/views/login.vue
index 02932ef..df7a011 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -96,7 +96,7 @@
   data() {
     return {
       codeUrl: "",
-      cookiePassword: "", 
+      cookiePassword: "",
       loginForm: {
         username: "",
         password: "",
@@ -182,10 +182,20 @@
           }
           this.$store
             .dispatch("Login", this.loginForm)
-            .then(() => {
-              this.$router.push({ path: this.redirect || "/" }).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.$store.state.user.msg);
+              }
             })
-            .catch(() => {
+            .catch(err => {
+              console.log(err);
               this.loading = false;
               // this.$message.error("鐧婚檰澶辫触璇烽噸璇曘��");
               if (this.captchaOnOff) {
@@ -206,14 +216,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;
 }

--
Gitblit v1.9.3