fix: privateDownloadUrl第二个参数是unix时间戳不是时长

This commit is contained in:
mediabot-pt
2026-07-01 21:33:33 +08:00
parent 2d2b174690
commit e5b68a715e

View File

@@ -87,9 +87,10 @@ public class QiniuStorageService implements StorageService {
log.warn("Qiniu stat 失败 {}: {}", path, e.response != null ? e.response.error : e.getMessage());
}
// HTTP 签名 URL 拉取(七牛默认CDN域名不支持HTTPS)
// HTTP 签名 URL(deadline=当前时间+1小时的Unix秒数)
String baseUrl = "http://" + downloadDomain + "/" + path;
String signedUrl = auth.privateDownloadUrl(baseUrl, 3600);
long deadline = System.currentTimeMillis() / 1000 + 3600;
String signedUrl = auth.privateDownloadUrl(baseUrl, deadline);
try {
var req = HttpRequest.newBuilder().uri(URI.create(signedUrl))
.timeout(Duration.ofSeconds(10)).GET().build();