diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/YomiGameServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/YomiGameServiceImpl.java index 1f919479..3c02437f 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/YomiGameServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/game/YomiGameServiceImpl.java @@ -33,6 +33,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; +import java.util.Optional; import java.util.concurrent.TimeUnit; /** @@ -81,11 +82,12 @@ public class YomiGameServiceImpl implements YomiGameService { long expireAt = System.currentTimeMillis() / 1000 + yomiConfig.getTokenExpireSeconds(); redisTemplate.opsForValue().set(buildTokenCacheKey(token), cmd.getPlatUserId(), yomiConfig.getTokenExpireSeconds(), TimeUnit.SECONDS); + String avatar = profile.getUserAvatar().isBlank() ? "-" : profile.getUserAvatar(); return YomiTokenCO.builder() .platUserId(cmd.getPlatUserId()) .platUserOpenId("") // 项目暂无 openId 概念,按协议传空 .nickname(profile.getUserNickname()) - .avatar(profile.getUserAvatar()) + .avatar(avatar) .balance(balanceResp.getBody().getDollarAmount().longValue()) .platToken(token) .expireAt(expireAt)