zhanghua
2025-03-04 0f5901bbc027e2e8d934280ca659734a61f67378
ycl-common/src/main/java/com/ycl/controller/FileController.java
@@ -10,6 +10,8 @@
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.UnsupportedEncodingException;
@RestController
@Api(tags = "文件上传")
@RequestMapping("/file")
@@ -64,7 +66,12 @@
    @ApiOperation(value = "删除图片")
    @PostMapping("media/delete")
    public CommonResult<Boolean> deleteImages(String fileUrl) {
        boolean flag = ossService.deleteImages(fileUrl);
        boolean flag = false;
        try {
            flag = ossService.deleteImages(fileUrl);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        if (flag) {
            return CommonResult.success(true, "删除成功");
        }