Skip to content

Commit 0c3f325

Browse files
authored
Java:MultiDataSource 解决上传图片后返回的路径错误
1 parent 42e2e40 commit 0c3f325

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

APIJSON-Java-Server/APIJSONBoot-MultiDataSource/src/main/java/apijson/boot/FileController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public JSONObject upload(@RequestParam("file") MultipartFile file) {
9494
fileRepository.add(file.getOriginalFilename());
9595

9696
JSONObject res = new JSONObject();
97-
res.put("path", file.getOriginalFilename());
97+
res.put("path", "/download/" + file.getOriginalFilename());
9898
res.put("size", file.getBytes().length);
9999
return new DemoParser().extendSuccessResult(res);
100100
}

0 commit comments

Comments
 (0)