|
@@ -40,10 +40,9 @@ public class UploadFileController extends BaseController {
|
|
private SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
private SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
|
|
|
|
|
@PostMapping(value = "uploadFile")
|
|
@PostMapping(value = "uploadFile")
|
|
- public Object uploadFile(@ApiParam(value = "上传的文件", required = true) @RequestParam("file") MultipartFile file,
|
|
|
|
- @RequestParam("bucket") BucketEnum bucket){
|
|
|
|
|
|
+ public Object uploadFile(@ApiParam(value = "上传的文件", required = true) @RequestParam("file") MultipartFile file){
|
|
try {
|
|
try {
|
|
- BucketContextHolder.setBucket(bucket);
|
|
|
|
|
|
+// BucketContextHolder.setBucket(bucket);
|
|
if (file != null && StringUtils.isNotBlank(file.getOriginalFilename())) {
|
|
if (file != null && StringUtils.isNotBlank(file.getOriginalFilename())) {
|
|
UploadReturnBean bean = uploadFileService.uploadFile(file.getInputStream(), UploadUtil.getExtension(file.getOriginalFilename()));
|
|
UploadReturnBean bean = uploadFileService.uploadFile(file.getInputStream(), UploadUtil.getExtension(file.getOriginalFilename()));
|
|
bean.setSize(file.getSize());
|
|
bean.setSize(file.getSize());
|
|
@@ -55,9 +54,10 @@ public class UploadFileController extends BaseController {
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
LOGGER.error("上传失败", e);
|
|
LOGGER.error("上传失败", e);
|
|
- }finally {
|
|
|
|
- BucketContextHolder.clearBucket();
|
|
|
|
}
|
|
}
|
|
|
|
+// finally {
|
|
|
|
+// BucketContextHolder.clearBucket();
|
|
|
|
+// }
|
|
return failed("上传失败");
|
|
return failed("上传失败");
|
|
}
|
|
}
|
|
|
|
|