BUGFIX:无法查看我的作品

This commit is contained in:
2025-09-02 23:46:40 +08:00
parent 8b2aab2e5e
commit 3c071378ad

View File

@@ -427,19 +427,19 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
@Override
public PageBaseResponse<PortfolioVO> page(QueryPortfolioPageDTO query) {
AuthPrincipalVo userHolder = UserContext.getUserHolder();
// AuthPrincipalVo userHolder = UserContext.getUserHolder();
QueryWrapper<Portfolio> qw = new QueryWrapper<>();
// 查询用户的作品集
if (query.getGetMyPortfolio() == 1) {
qw.lambda().eq(Portfolio::getAccountId, userHolder.getId());
qw.lambda().eq(Portfolio::getAccountId, query.getAccountId());
} else if (!Objects.isNull(query.getAccountId()) && !query.getAccountId().equals(0L)) {
qw.lambda().eq(Portfolio::getAccountId, query.getAccountId());
}
// 查询用户喜欢的作品集
if (query.getGetLikePortfolio() == 1) {
List<Long> likedPortfolioIdList = redisUtil.getLikedPortfolios(userHolder.getId());
List<Long> likedPortfolioIdList = redisUtil.getLikedPortfolios(query.getAccountId());
if (!CollectionUtils.isEmpty(likedPortfolioIdList)) {
qw.lambda().in(Portfolio::getId, likedPortfolioIdList);
} else {