From 928e418f3f7884048ae3368bce88acd3c106f13d Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期四, 18 一月 2024 17:48:07 +0800
Subject: [PATCH] add 增加 赞助商 数驼科技

---
 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java
index f0e12f6..565995d 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java
@@ -64,7 +64,12 @@
         for (Long id : ossIds) {
             SysOssVo vo = SpringUtils.getAopProxy(this).getById(id);
             if (ObjectUtil.isNotNull(vo)) {
-                list.add(this.matchingUrl(vo));
+                try {
+                    list.add(this.matchingUrl(vo));
+                } catch (Exception ignored) {
+                    // 濡傛灉oss寮傚父鏃犳硶杩炴帴鍒欏皢鏁版嵁鐩存帴杩斿洖
+                    list.add(vo);
+                }
             }
         }
         return list;
@@ -76,7 +81,12 @@
         for (Long id : StringUtils.splitTo(ossIds, Convert::toLong)) {
             SysOssVo vo = SpringUtils.getAopProxy(this).getById(id);
             if (ObjectUtil.isNotNull(vo)) {
-                list.add(this.matchingUrl(vo).getUrl());
+                try {
+                    list.add(this.matchingUrl(vo).getUrl());
+                } catch (Exception ignored) {
+                    // 濡傛灉oss寮傚父鏃犳硶杩炴帴鍒欏皢鏁版嵁鐩存帴杩斿洖
+                    list.add(vo.getUrl());
+                }
             }
         }
         return String.join(StringUtils.SEPARATOR, list);
@@ -128,7 +138,7 @@
         OssClient storage = OssFactory.instance();
         UploadResult uploadResult;
         try {
-            uploadResult = storage.uploadSuffix(file.getBytes(), suffix, file.getContentType());
+            uploadResult = storage.uploadSuffix(file.getBytes(), suffix);
         } catch (IOException e) {
             throw new ServiceException(e.getMessage());
         }

--
Gitblit v1.9.3