| | |
| | | // String imageName = "uploadeFile/image/" + System.currentTimeMillis() + IdUtil.simpleUUID() + AppContants.UPLOAD_IMAGE_SUFFIX; |
| | | // boolean flag = OssUtils.uploadFileWithBase64(uploadDto.base64Str, imageName); |
| | | |
| | | String imagesPath = filePath + "/" + DateUtil.format(new Date(), "yyyyMMdd"); |
| | | String dateStr = DateUtil.format(new Date(), "yyyyMMdd"); |
| | | String imagesPath = filePath + "/" + dateStr; |
| | | File pathFile = new File(imagesPath); |
| | | if (pathFile.isDirectory()) { |
| | | |
| | | if (!pathFile.exists()) { |
| | | pathFile.mkdirs(); |
| | | } |
| | | |
| | |
| | | boolean flag = ImageUtils.base64ToImg(uploadDto.base64Str, imagesPath + "/" + imageName); |
| | | if (flag) { |
| | | // String url = aliOssProperties.getBucketName() + "/" + imageName; |
| | | String url = fileUrl + imageName; |
| | | String url = fileUrl + dateStr + "/" + imageName; |
| | | return Result.ok(MessageSourceUtils.getString("result_success_msg"), url); |
| | | } |
| | | return Result.fail(MessageSourceUtils.getString("uploadFile_controller_0001")); |