文件上传
parent
df23750203
commit
145238ea96
|
@ -56,7 +56,8 @@ public class FileController {
|
|||
})
|
||||
public CommonResult<String> uploadFile(@RequestParam("file") MultipartFile file) throws Exception {
|
||||
String path = DateUtil.format(new Date(), "yyyy/MM/dd/") + file.getOriginalFilename();
|
||||
return success(fileService.createFile(path, IoUtil.readBytes(file.getInputStream())));
|
||||
String file1 = fileService.createFile(path, IoUtil.readBytes(file.getInputStream()));
|
||||
return success(file1);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
|
|
|
@ -127,7 +127,7 @@ export default {
|
|||
},
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res) {
|
||||
this.uploadList.push({ name: res.fileName, url: res.fileName });
|
||||
this.uploadList.push({ name: res.data, url: res.data });
|
||||
if (this.uploadList.length === this.number) {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.uploadList = [];
|
||||
|
|
Loading…
Reference in New Issue