测试token恢复

This commit is contained in:
litianxiang
2026-02-25 16:36:06 +08:00
parent 3bbdf7c672
commit 1ac01dd090

View File

@@ -61,7 +61,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService {
private final RedisUtil redisUtil;
@Value("${file.upload.dir:uploads}")
@Value("${file.upload.temp.dir}")
private String uploadDir;
private static final DateTimeFormatter YYYY_MM_DD = DateTimeFormatter.ofPattern("yyyy/MM");
@@ -443,8 +443,7 @@ public class GlobalAwardServiceImpl implements GlobalAwardService {
throw new BusinessException("Please complete email verification first.");
}
// String tokenCache = redisUtil.getFromString(key);
String tokenCache = "123456";
String tokenCache = redisUtil.getFromString(key);
if (StringUtils.isBlank(tokenCache)) {
log.error("security token 过期");
throw new BusinessException("Email verification has expired. Please verify again.");
@@ -527,8 +526,10 @@ public class GlobalAwardServiceImpl implements GlobalAwardService {
String pdfPath = contestant.getPdfPath();
if (StringUtils.isNotBlank(pdfPath)) {
try {
String fileName = pdfPath.contains("/") ?
pdfPath.substring(pdfPath.lastIndexOf("/") + 1) : "design.pdf";
downloadFileFromMinio(pdfPath, contestantPath.toString(), "design.pdf");
log.info("Downloaded PDF for contestant {}", contestantNumber);
log.info("Downloaded PDF for contestant {}", fileName);
} catch (Exception e) {
log.error("Failed to download PDF for contestant {}: {}", contestantNumber, e.getMessage());
}