Skip to content

Commit

Permalink
[Bug]The new user configuration and the new team cannot log in properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Forus0322 committed Dec 5, 2024
1 parent 0edd035 commit 1d94b75
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
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;
Expand Down Expand Up @@ -287,6 +288,13 @@ public Map<String, Object> generateFrontendUserInfo(User user, JWTToken token) {
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);
Expand Down

0 comments on commit 1d94b75

Please sign in to comment.