From a47397d8c778bd80684371dff9a944bb3e5ce483 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 22 七月 2025 11:59:09 +0800
Subject: [PATCH] 1.头像未展示bug

---
 src/store/modules/user.js |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index ba555bc..7c392fc 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -35,12 +35,9 @@
       getInfo() {
         return new Promise((resolve, reject) => {
           getInfo().then(res => {
-            console.log('user',res)
             const user = res.user
             let avatar = user.avatar || ""
-            if (!isHttp(avatar)) {
-              avatar = (isEmpty(avatar)) ? defAva : import.meta.env.VITE_APP_BASE_API + avatar
-            }
+            avatar = import.meta.env.VITE_APP_BASE_API + '/profile/' + avatar
             if (res.roles && res.roles.length > 0) { // 楠岃瘉杩斿洖鐨剅oles鏄惁鏄竴涓潪绌烘暟缁�
               this.roles = res.roles
               this.permissions = res.permissions
@@ -50,7 +47,9 @@
             this.id = user.userId
             this.name = user.userName
             this.avatar = avatar
+            this.currentFactoryName = user.currentFactoryName
             this.nickName = user.nickName
+            this.currentDeptId = user.tenantId
             resolve(res)
           }).catch(error => {
             reject(error)
@@ -87,7 +86,7 @@
       loginCheckFactory(userInfo) {
         const username = userInfo.username.trim()
         const password = userInfo.password
-        const factoryId = userInfo.factoryId
+        const factoryId = userInfo.currentFatoryId
         return new Promise((resolve, reject) => {
           loginCheckFactory(username, password, factoryId).then(res => {
             setToken(res.token)

--
Gitblit v1.9.3