From 6ac0e6669f3a8ea18c7ac90b37405c65313a1c5f Mon Sep 17 00:00:00 2001
From: kongdeqiang <123456>
Date: 星期五, 26 十二月 2025 16:53:40 +0800
Subject: [PATCH] feat: 修改登录bug

---
 src/store/state.js            |    4 ++--
 src/components/page/Login.vue |   35 ++++++++++++++++++++---------------
 2 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue
index be8da3c..ac8807a 100644
--- a/src/components/page/Login.vue
+++ b/src/components/page/Login.vue
@@ -59,22 +59,27 @@
                     if (valid) {
                         var url = this.$systemconfig.basePath + '/ffzf/user/login';
                         this.$byutil.postData(this,url,this.ruleForm,res=>{
+                          if (res.code == 0) {
                             let data = res.data;
-                          if (data) {
-                            localStorage.userId = data.id;
-                            localStorage.name = data.name;
-                            localStorage.type = data.type;
-                            // localStorage.userRouters = JSON.stringify(this.items) ;
-                            this.SET_ROLES(data.type)
-                            this.SET_ROLELISt();  // 绛涢�夊乏渚ц彍鍗曟爮
-                            this.$router.push({'path': this.resultAsyncRoutes[0].children[0].indexUrl || '/home'});
-                             // 鑷姩璺宠浆褰撳墠鏉冮檺璺敱鐨勭涓�涓〉闈� 锛屽鏋滄壘涓嶅埌灏卞幓璺砲ome
-                            // if (this._isMobile()) {
-                            //     this.$router.push({'path': '/index4'});
-                            // } else {
-                            //     this.$router.push({'path': '/index'});
-                            // }
-                        }
+                            if (data) {
+                              localStorage.userId = data.id;
+                              localStorage.name = data.name;
+                              localStorage.type = data.type;
+                              // localStorage.userRouters = JSON.stringify(this.items) ;
+                              this.SET_ROLES(data.type)
+                              this.SET_ROLELISt();  // 绛涢�夊乏渚ц彍鍗曟爮
+                              this.$router.push({'path': this.resultAsyncRoutes[0].children[0].indexUrl || '/home'});
+                              // 鑷姩璺宠浆褰撳墠鏉冮檺璺敱鐨勭涓�涓〉闈� 锛屽鏋滄壘涓嶅埌灏卞幓璺砲ome
+                              // if (this._isMobile()) {
+                              //     this.$router.push({'path': '/index4'});
+                              // } else {
+                              //     this.$router.push({'path': '/index'});
+                              // }
+                            }
+                        }else {
+                            this.$message.error(res.msg);
+                          }
+
                     })
                     } else {
                         return false;
diff --git a/src/store/state.js b/src/store/state.js
index cb62b56..7632504 100644
--- a/src/store/state.js
+++ b/src/store/state.js
@@ -145,13 +145,13 @@
           children:[
             {
               icon: 'el-icon-user-solid',
-              name: '宸℃鐧昏',
+              name: '宸℃璁板綍绠$悊',
               parentId: 4,
               indexUrl: 'inspectionRegistration'
             },
             {
               icon: 'el-icon-user-solid',
-              name: '缁翠慨缁存姢绠$悊杞欢',
+              name: '缁翠慨缁存姢绠$悊',
               parentId: 4,
               indexUrl: 'repairAndMaintenance'
             },

--
Gitblit v1.9.1