Commit 0e1f2682658a27df0f2c497a5daaf3a1af6f734b
1 parent
0eb477a6ab
Exists in
master
and in
1 other branch
图片显示
Showing 2 changed files with 4 additions and 2 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java
View file @
0e1f268
| ... | ... | @@ -84,7 +84,7 @@ |
| 84 | 84 | */ |
| 85 | 85 | @GetMapping("showPic/{fileName}") |
| 86 | 86 | public void showPic(@PathVariable("fileName") String fileName, HttpServletResponse response) { |
| 87 | - try(InputStream in=new FileInputStream(new File(fileName)); | |
| 87 | + try(InputStream in=new FileInputStream(new File(uploadPath + File.separator +fileName)); | |
| 88 | 88 | OutputStream out=response.getOutputStream(); |
| 89 | 89 | ){ |
| 90 | 90 | IOUtils.copy(in,out); |
talkonlineweb/src/main/resources/application-dev.yml
View file @
0e1f268
| ... | ... | @@ -7,7 +7,9 @@ |
| 7 | 7 | username: platform |
| 8 | 8 | password: Platform@123 |
| 9 | 9 | uploadPath: /data/talkonline/upload/ |
| 10 | -imgUrlPre: https://dev-talk-api.healthbaby.com.cn/showPic/ | |
| 10 | +#uploadPath: D:/test/upload/ | |
| 11 | +imgUrlPre: https://dev-talk-api.healthbaby.com.cn/art/showPic/ | |
| 12 | +#imgUrlPre: http://192.168.2.26:9090/art/showPic/ | |
| 11 | 13 | |
| 12 | 14 | |
| 13 | 15 | #环信配置 |