Commit ed1b55fed7ca4dc1e12bfb1b60d961af55e99bbb
1 parent
0f6f2043
🐛 文件路径 url 中文解码问题
Showing
1 changed file
with
3 additions
and
0 deletions
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
| ... | ... | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.infra.controller.admin.file; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.io.IoUtil; |
| 4 | 4 | import cn.hutool.core.util.StrUtil; |
| 5 | +import cn.hutool.core.util.URLUtil; | |
| 5 | 6 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 6 | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 8 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| ... | ... | @@ -70,6 +71,8 @@ public class FileController { |
| 70 | 71 | if (StrUtil.isEmpty(path)) { |
| 71 | 72 | throw new IllegalArgumentException("结尾的 path 路径必须传递"); |
| 72 | 73 | } |
| 74 | + // 解码,解决中文路径的问题 https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/807/ | |
| 75 | + path = URLUtil.decode(path); | |
| 73 | 76 | |
| 74 | 77 | // 读取内容 |
| 75 | 78 | byte[] content = fileService.getFileContent(configId, path); | ... | ... |