🐛 修复本地存储不支持上传大小为 0 的文件.

This commit is contained in:
zhaojun
2022-11-26 17:59:14 +08:00
parent 5f84becf08
commit d12cbd2383

View File

@@ -38,8 +38,8 @@ public class ProxyUploadController {
@PostMapping("/file/upload/{storageKey}/**")
@ResponseBody
public AjaxJson<?> upload(@RequestParam MultipartFile file, @PathVariable("storageKey") String storageKey) throws IOException {
if (file == null || file.isEmpty()) {
return AjaxJson.getError("文件为空,无法上传.");
if (file == null) {
throw new RuntimeException("文件不能为空");
}
// 获取上传路径