From e747a23e38f1db8924b90af6ea90a29fd5a0058a Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Wed, 03 Jan 2024 09:28:18 +0800
Subject: [PATCH] 登录修改

---
 src/store/modules/user.js    |    4 +---
 src/page/login/userlogin.vue |   34 +++++++++++++++++++---------------
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index b2a65e5..f5c4941 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -49,6 +49,7 @@
 import {info} from "@/api/system/tenant"
 import {getCaptcha} from "@/api/user"
 import {getTopUrl} from "@/util/util"
+import {Message} from "element-ui";
 
 export default {
   name: "userlogin",
@@ -120,22 +121,25 @@
           })
           this.$store
             .dispatch("LoginByUsername", this.loginForm)
-            .then(() => {
-              console.log("userInfo",this.userInfo)
-              this.$store.dispatch("GetMenu", [this.userInfo, ""]).then((data) => {
-                //登录跳转首页改完跳转保安单位情况智能分析
-                let path = this.tagWel.value
-
-                let menu = data.filter(e => e.path == "/securityAnalysis/index")
-                if (menu.length > 0) {
-                  path = '/securityAnalysis'
-                }
-                if (this.userInfo.role_name.indexOf("考勤管理员") > -1) {
-                  path = "check/record"
-                }
-                this.$router.push({path: path})
+            .then((data) => {
+              if (data.error_description) {
                 loading.close()
-              });
+              }else{
+                this.$store.dispatch("GetMenu", [this.userInfo, ""]).then((data) => {
+                  //登录跳转首页改完跳转保安单位情况智能分析
+                  let path = this.tagWel.value
+
+                  let menu = data.filter(e => e.path == "/securityAnalysis/index")
+                  if (menu.length > 0) {
+                    path = '/securityAnalysis'
+                  }
+                  if (this.userInfo.role_name.indexOf("考勤管理员") > -1) {
+                    path = "check/record"
+                  }
+                  this.$router.push({path: path})
+                  loading.close()
+                });
+              }
             })
             .catch(() => {
               loading.close()
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index a02c72f..36f57fd 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -50,9 +50,7 @@
     LoginByUsername({ commit }, userInfo) {
       return new Promise((resolve, reject) => {
         loginByUsername(userInfo.tenantId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => {
-          // debugger;
           const data = res.data;
-          // console.log(res.data, 'datadatadatadatadata')
           if (data.error_description) {
             Message({
               message: data.error_description,
@@ -66,7 +64,7 @@
             commit('DEL_ALL_TAG');
             commit('CLEAR_LOCK');
           }
-          resolve();
+          resolve(data);
         }).catch(error => {
           reject(error);
         })

--
Gitblit v1.9.3