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/QcloudCloudStorageStrategy.java |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QcloudCloudStorageStrategy.java b/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QcloudCloudStorageStrategy.java
index c30dcbd..9bd366e 100644
--- a/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QcloudCloudStorageStrategy.java
+++ b/ruoyi-oss/src/main/java/com/ruoyi/oss/service/impl/QcloudCloudStorageStrategy.java
@@ -24,9 +24,10 @@
  */
 public class QcloudCloudStorageStrategy extends AbstractCloudStorageStrategy {
 
-	private final COSClient client;
+	private COSClient client;
 
-	public QcloudCloudStorageStrategy(CloudStorageProperties cloudStorageProperties) {
+	@Override
+	public void init(CloudStorageProperties cloudStorageProperties) {
 		properties = cloudStorageProperties;
 		try {
 			COSCredentials credentials = new BasicCOSCredentials(
@@ -43,7 +44,7 @@
 			client = new COSClient(credentials, clientConfig);
 			createBucket();
 		} catch (Exception e) {
-			throw new IllegalArgumentException("鑵捐浜戝瓨鍌ㄩ厤缃敊璇�! 璇锋鏌ョ郴缁熼厤缃�!");
+			throw new OssException("鑵捐浜戝瓨鍌ㄩ厤缃敊璇�! 璇锋鏌ョ郴缁熼厤缃�:[" + e.getMessage() + "]");
 		}
 	}
 
@@ -58,7 +59,7 @@
 			createBucketRequest.setCannedAcl(CannedAccessControlList.PublicRead);
 			client.createBucket(createBucketRequest);
 		} catch (Exception e) {
-			throw new OssException("鍒涘缓Bucket澶辫触, 璇锋牳瀵硅吘璁簯閰嶇疆淇℃伅");
+			throw new OssException("鍒涘缓Bucket澶辫触, 璇锋牳瀵硅吘璁簯閰嶇疆淇℃伅:[" + e.getMessage() + "]");
 		}
 	}
 
@@ -79,7 +80,7 @@
 			metadata.setContentType(contentType);
 			client.putObject(new PutObjectRequest(properties.getBucketName(), path, inputStream, metadata));
 		} catch (Exception e) {
-			throw new OssException("涓婁紶鏂囦欢澶辫触锛岃妫�鏌ヨ吘璁簯閰嶇疆淇℃伅");
+			throw new OssException("涓婁紶鏂囦欢澶辫触锛岃妫�鏌ヨ吘璁簯閰嶇疆淇℃伅:[" + e.getMessage() + "]");
 		}
 		return new UploadResult().setUrl(getEndpointLink() + "/" + path).setFilename(path);
 	}
@@ -90,7 +91,7 @@
 		try {
 			client.deleteObject(new DeleteObjectRequest(properties.getBucketName(), path));
 		} catch (Exception e) {
-			throw new OssException("涓婁紶鏂囦欢澶辫触锛岃妫�鑵捐浜戞煡閰嶇疆淇℃伅");
+			throw new OssException("涓婁紶鏂囦欢澶辫触锛岃妫�鑵捐浜戞煡閰嶇疆淇℃伅:[" + e.getMessage() + "]");
 		}
 	}
 

--
Gitblit v1.9.3