调整
This commit is contained in:
parent
339b84d556
commit
9de31fa1e6
@ -94,11 +94,13 @@ public class BusUserController {
|
||||
throw new BadRequestException("只能上传图片");
|
||||
}
|
||||
String type = FileUtil.getFileType(suffix);
|
||||
File uploadFile = FileUtil.upload(file, fileProperties.getPath().getPath() + type + File.separator);
|
||||
String path = fileProperties.getPath().getPath();
|
||||
File uploadFile = FileUtil.upload(file, path + type + File.separator);
|
||||
if(ObjectUtil.isNull(uploadFile)){
|
||||
throw new BadRequestException("上传失败");
|
||||
}
|
||||
return new ResponseEntity<>(uploadFile.getName(), HttpStatus.OK);
|
||||
String[] split = path.split("/");
|
||||
return new ResponseEntity<>("/" + split[split.length - 1] + "/" + type + "/" + uploadFile.getName(), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user