| | |
| | | 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); |
| | |
| | | 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()); |
| | | } |