We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3eb27c commit 513ed87Copy full SHA for 513ed87
springboot-dubbo-web/src/main/java/com/lzq/web/utils/QiniuyunUtils.java
@@ -80,13 +80,14 @@ public static String uploadFiles(byte[] bytes) {
80
return putRet.key;
81
}
82
83
- public static String uploadFile(File file) {
+ public static String uploadFile(File file,String username) {
84
+ long time = System.currentTimeMillis();
85
//构造一个带指定 Region 对象的配置类
86
Configuration cfg = new Configuration(Region.huanan());
87
//...其他参数参考类注释
88
UploadManager uploadManager = new UploadManager(cfg);
89
//默认不指定key的情况下,以文件内容的hash值作为文件名
- String key = null;
90
+ String key = username+time;
91
Auth auth = Auth.create(ACCESSKEY, SECRETKEY);
92
String upToken = auth.uploadToken(BUCKET);
93
0 commit comments