From b461c8cc99dd46f4d76efb48626bbea8ac223661 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期三, 01 九月 2021 15:38:08 +0800 Subject: [PATCH] update spring-boot-admin 2.5.0 => 2.5.1 update aliyun.oss 3.13.0 => 3.13.1 update qcloud.cos 5.6.47 => 5.6.51 update hutool 5.7.9 => 5.7.11 update maven-jar-plugin 3.1.1 => 3.2.0 --- ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QiniuCloudStorageStrategy.java | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QiniuCloudStorageStrategy.java b/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QiniuCloudStorageStrategy.java index ef22513..e9b8dc0 100644 --- a/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QiniuCloudStorageStrategy.java +++ b/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QiniuCloudStorageStrategy.java @@ -22,11 +22,12 @@ */ public class QiniuCloudStorageStrategy extends AbstractCloudStorageStrategy { - private final UploadManager uploadManager; - private final BucketManager bucketManager; - private final String token; + private UploadManager uploadManager; + private BucketManager bucketManager; + private String token; - public QiniuCloudStorageStrategy(CloudStorageProperties cloudStorageProperties) { + @Override + public void init(CloudStorageProperties cloudStorageProperties) { properties = cloudStorageProperties; try { Configuration config = new Configuration(getRegion(properties.getRegion())); @@ -43,7 +44,7 @@ bucketManager.createBucket(bucketName, properties.getRegion()); } } catch (Exception e) { - throw new IllegalArgumentException("涓冪墰浜戝瓨鍌ㄩ厤缃敊璇�! 璇锋鏌ョ郴缁熼厤缃�!"); + throw new OssException("涓冪墰浜戝瓨鍌ㄩ厤缃敊璇�! 璇锋鏌ョ郴缁熼厤缃�:[" + e.getMessage() + "]"); } } @@ -56,7 +57,7 @@ } bucketManager.createBucket(bucketName, properties.getRegion()); } catch (Exception e) { - throw new OssException("鍒涘缓Bucket澶辫触, 璇锋牳瀵逛竷鐗涗簯閰嶇疆淇℃伅"); + throw new OssException("鍒涘缓Bucket澶辫触, 璇锋牳瀵逛竷鐗涗簯閰嶇疆淇℃伅:[" + e.getMessage() + "]"); } } @@ -73,7 +74,7 @@ throw new RuntimeException("涓婁紶涓冪墰鍑洪敊锛�" + res.toString()); } } catch (Exception e) { - throw new OssException("涓婁紶鏂囦欢澶辫触锛岃鏍稿涓冪墰閰嶇疆淇℃伅"); + throw new OssException("涓婁紶鏂囦欢澶辫触锛岃鏍稿涓冪墰閰嶇疆淇℃伅:[" + e.getMessage() + "]"); } return new UploadResult().setUrl(getEndpointLink() + "/" + path).setFilename(path); } -- Gitblit v1.9.3