This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev by this push:
     new 9c7387fcc The new user configuration and the new team cannot log in 
properly. (#4142)
9c7387fcc is described below

commit 9c7387fcce3a19c6074d0eeb9d0979409c8529af
Author: Forus <[email protected]>
AuthorDate: Sun Jan 12 09:08:29 2025 +0800

    The new user configuration and the new team cannot log in properly. (#4142)
    
    * [Improve] The start time may be null.#4140
    
    * [Bug]The new user configuration and the new team cannot log in properly.
---
 .../streampark/console/system/service/impl/UserServiceImpl.java   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
index 7f484f916..dc2095ee6 100644
--- 
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
+++ 
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java
@@ -33,6 +33,7 @@ import 
org.apache.streampark.console.system.authentication.JWTToken;
 import org.apache.streampark.console.system.authentication.JWTUtil;
 import org.apache.streampark.console.system.entity.Member;
 import org.apache.streampark.console.system.entity.Role;
+import org.apache.streampark.console.system.entity.Team;
 import org.apache.streampark.console.system.entity.User;
 import org.apache.streampark.console.system.mapper.UserMapper;
 import org.apache.streampark.console.system.service.MemberService;
@@ -287,6 +288,13 @@ public class UserServiceImpl extends 
ServiceImpl<UserMapper, User> implements Us
         user.dataMasking();
         userInfo.put("user", user);
 
+        if (user.getLastTeamId() == null) {
+            List<Team> teams = this.teamService.listByUserId(user.getUserId());
+            if (!teams.isEmpty()) {
+                user.setLastTeamId(teams.get(0).getId());
+            }
+        }
+
         // 3) permissions
         Set<String> permissions = this.listPermissions(user.getUserId(), 
user.getLastTeamId());
         userInfo.put("permissions", permissions);

Reply via email to