fix: Qiniu 上传令牌改为 key 作用域,支持覆盖已有文件

This commit is contained in:
mediabot-pt
2026-07-07 18:16:05 +08:00
parent f2fd0ce2a0
commit dfbedcf09d

View File

@@ -65,7 +65,7 @@ public class QiniuStorageService implements StorageService {
public void store(String path, String content) { public void store(String path, String content) {
ensureInit(); ensureInit();
try { try {
uploadManager.put(content.getBytes(), path, auth.uploadToken(bucket)); uploadManager.put(content.getBytes(), path, auth.uploadToken(bucket, path));
log.debug("Qiniu 上传: {}", path); log.debug("Qiniu 上传: {}", path);
} catch (QiniuException e) { } catch (QiniuException e) {
String detail = e.response != null ? "code=" + e.response.statusCode + " " + e.response.error : e.getMessage(); String detail = e.response != null ? "code=" + e.response.statusCode + " " + e.response.error : e.getMessage();