From 145238ea967afa381086fd354982fec7defb035e Mon Sep 17 00:00:00 2001 From: JeromeSoar Date: Sun, 24 Apr 2022 18:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/infra/controller/admin/file/FileController.java | 3 ++- yudao-ui-admin/src/components/ImageUpload/index.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java index 3ec24c9b1..f53b45ac8 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java @@ -56,7 +56,8 @@ public class FileController { }) public CommonResult 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") diff --git a/yudao-ui-admin/src/components/ImageUpload/index.vue b/yudao-ui-admin/src/components/ImageUpload/index.vue index 3462f250d..b736b7240 100644 --- a/yudao-ui-admin/src/components/ImageUpload/index.vue +++ b/yudao-ui-admin/src/components/ImageUpload/index.vue @@ -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 = [];