master
管理员 1 year ago
parent 294a85abc5
commit b6102cfe45

@ -32,11 +32,11 @@ public class UploadController {
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public R upload(@RequestPart("file") MultipartFile file, String pre) {
public R upload(@RequestPart("file") MultipartFile file, String pre,@RequestParam(defaultValue = "false") Boolean keepFilename) {
if (ObjectUtil.isNull(file)) {
throw new ServiceException("文件为空");
}
return R.map().put("ossId",0).put("url",fileService.setPrefix(pre).setKeepFilename().save(file));
return R.map().put("ossId",0).put("url",fileService.setPrefix(pre).setKeepFilename(keepFilename).save(file));
}
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)

Loading…
Cancel
Save