deason 1 年之前
父节点
当前提交
305d0e3a75

+ 4 - 4
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/fss/impl/AliyunOssService.java

@@ -138,8 +138,8 @@ public class AliyunOssService implements FssService {
             FssHelper.makeDirs(toFile.getParent());
             client.getObject(request, toFile);
         } catch (Exception e) {
-            log.error("文件下载失败!filePath:{} err:{}", filePath, e.getMessage());
-            throw new StatusException("文件下载失败!");
+            log.error("文件读取失败!filePath:{} err:{}", filePath, e.getMessage());
+            throw new StatusException("文件读取失败!");
         } finally {
             try {
                 client.shutdown();
@@ -171,8 +171,8 @@ public class AliyunOssService implements FssService {
 
             return bos.toByteArray();
         } catch (Exception e) {
-            log.error("文件下载失败!filePath:{} err:{}", filePath, e.getMessage());
-            throw new StatusException("文件下载失败!");
+            log.error("文件读取失败!filePath:{} err:{}", filePath, e.getMessage());
+            throw new StatusException("文件读取失败!");
         } finally {
             try {
                 if (is != null) {

+ 4 - 4
examcloud-support/src/main/java/cn/com/qmth/examcloud/support/fss/impl/TencentCosService.java

@@ -128,8 +128,8 @@ public class TencentCosService implements FssService {
             FssHelper.makeDirs(toFile.getParent());
             client.getObject(request, toFile);
         } catch (Exception e) {
-            log.error("文件下载失败!filePath:{} err:{}", filePath, e.getMessage());
-            throw new StatusException("文件下载失败!");
+            log.error("文件读取失败!filePath:{} err:{}", filePath, e.getMessage());
+            throw new StatusException("文件读取失败!");
         } finally {
             try {
                 client.shutdown();
@@ -161,8 +161,8 @@ public class TencentCosService implements FssService {
 
             return bos.toByteArray();
         } catch (Exception e) {
-            log.error("文件下载失败!filePath:{} err:{}", filePath, e.getMessage());
-            throw new StatusException("文件下载失败!");
+            log.error("文件读取失败!filePath:{} err:{}", filePath, e.getMessage());
+            throw new StatusException("文件读取失败!");
         } finally {
             try {
                 if (is != null) {

+ 5 - 9
examcloud-support/src/main/java/cn/com/qmth/examcloud/web/config/SystemProperties.java

@@ -39,23 +39,19 @@ public class SystemProperties {
     @Value("${examcloud.web.sys.tempDataDir:tempDataDir}")
     private String tempDataDir;
 
-    @Value("${$aliyun.site.1.bucket}")
+    @Value("${$aliyun.site.1.bucket:}")
     private String aliyunBucketName;
 
-    /**
-     * 正式环境,此地址默认为阿里云内网域名(阿里云环境时,推荐使用)
-     * 其它环境:非阿里云内网域名
-     */
-    @Value("${$aliyun.site.1.ossEndpoint}")
+    @Value("${$aliyun.site.1.ossEndpoint:}")
     private String aliyunOssEndpoint;
 
-    @Value("${$aliyun.site.1.domain}")
+    @Value("${$aliyun.site.1.domain:}")
     private String aliyunDomain;
 
-    @Value("${$aliyun.site.1.accessKeyId}")
+    @Value("${$aliyun.site.1.accessKeyId:}")
     private String accessKeyId;
 
-    @Value("${$aliyun.site.1.accessKeySecret}")
+    @Value("${$aliyun.site.1.accessKeySecret:}")
     private String accessKeySecret;
 
     /**