yomi 游戏 兼容空头像处理
This commit is contained in:
parent
982cbddb77
commit
9bdce9a98c
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user