diff --git a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java index feff5cc3..210da7de 100644 --- a/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GlobalAwardServiceImpl.java @@ -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()); }