| | |
| | | } |
| | | |
| | | @Override |
| | | public String uploadImages(InputStream inputStream, String ext) { |
| | | public String uploadImages(InputStream inputStream, String ext, Integer times) { |
| | | if (times < 3) { |
| | | String endpoint = ConstantPropertiesUtils.END_POINT; |
| | | String accessKeyId = ConstantPropertiesUtils.ACCESS_KEY_ID; |
| | | String accessKeySecret = ConstantPropertiesUtils.ACCESS_KEY_SECRET; |
| | |
| | | |
| | | // System.out.println("上传完成--" + dtf2.format(LocalDateTime.now())); |
| | | return url; |
| | | |
| | | } catch (Exception e) { |
| | | System.out.println("oss异常:" + e.getMessage()); |
| | | // e.printStackTrace(); |
| | | return this.uploadImages(inputStream, ext); |
| | | return this.uploadImages(inputStream, ext, times + 1); |
| | | } |
| | | } else { |
| | | return ""; |
| | | } |
| | | } |
| | | |