fix: privateDownloadUrl第二个参数是unix时间戳不是时长
This commit is contained in:
@@ -87,9 +87,10 @@ public class QiniuStorageService implements StorageService {
|
|||||||
log.warn("Qiniu stat 失败 {}: {}", path, e.response != null ? e.response.error : e.getMessage());
|
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 baseUrl = "http://" + downloadDomain + "/" + path;
|
||||||
String signedUrl = auth.privateDownloadUrl(baseUrl, 3600);
|
long deadline = System.currentTimeMillis() / 1000 + 3600;
|
||||||
|
String signedUrl = auth.privateDownloadUrl(baseUrl, deadline);
|
||||||
try {
|
try {
|
||||||
var req = HttpRequest.newBuilder().uri(URI.create(signedUrl))
|
var req = HttpRequest.newBuilder().uri(URI.create(signedUrl))
|
||||||
.timeout(Duration.ofSeconds(10)).GET().build();
|
.timeout(Duration.ofSeconds(10)).GET().build();
|
||||||
|
|||||||
Reference in New Issue
Block a user