[Feature-8530][API] add system default timezone if no user timezone when get userInfo (#8899)

Co-authored-by: caishunfeng <534328519@qq.com>
This commit is contained in:
caishunfeng 2022-03-15 17:46:41 +08:00 committed by GitHub
parent 58e341c19c
commit 60fbbcb790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,6 +66,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.stream.Collectors;
import org.slf4j.Logger;
@ -886,6 +887,11 @@ public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
}
}
// add system default timezone if not user timezone
if (StringUtils.isEmpty(user.getTimeZone())) {
user.setTimeZone(TimeZone.getDefault().toZoneId().getId());
}
result.put(Constants.DATA_LIST, user);
putMsg(result, Status.SUCCESS);