wolfboys commented on code in PR #1792:
URL:
https://github.com/apache/incubator-streampark/pull/1792#discussion_r991328791
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java:
##########
@@ -177,12 +184,35 @@ public List<User> getNoTokenUser() {
return users;
}
+ @Override
+ public void setLatestTeam(Long teamId, Long userId) {
+ User user = getById(userId);
+ AssertUtils.checkArgument(user != null);
+ user.setTeamId(teamId);
+ this.baseMapper.updateById(user);
+ }
+
+ @Override
+ public void checkTeam(User user) {
+ if (user.getTeamId() == null) {
+ List<Team> teams = memberService.findUserTeams(user.getUserId());
+ if (CollectionUtils.isEmpty(teams)) {
+ throw new ApiException("There is no team to assign, please
contact the administrator!");
Review Comment:
> I create a new user, and doesn't belong to any team. When the user login
the platform, the front-end just show `No permission, please contact the
administrator`.
>
> So I guess this alert doesn't take affect.
I have dealt with it uniformly. The front-end does not need to write code,
the message will be presented to the user on the front-end:
<img width="555" alt="image"
src="https://user-images.githubusercontent.com/13284744/194882198-d5bc681c-9dcc-47df-a6e4-0addaf4f217c.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]