fix:【infra 基础设施】文件路径url "+"号解码问题
This commit is contained in:
@@ -26,6 +26,7 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
@@ -99,8 +100,10 @@ public class FileController {
|
|||||||
if (StrUtil.isEmpty(path)) {
|
if (StrUtil.isEmpty(path)) {
|
||||||
throw new IllegalArgumentException("结尾的 path 路径必须传递");
|
throw new IllegalArgumentException("结尾的 path 路径必须传递");
|
||||||
}
|
}
|
||||||
// 解码,解决中文路径的问题 https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/807/
|
// 解码,解决中文路径的问题
|
||||||
path = URLUtil.decode(path);
|
// https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/807/
|
||||||
|
// https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/1432/
|
||||||
|
path = URLUtil.decode(path, StandardCharsets.UTF_8, false);
|
||||||
|
|
||||||
// 读取内容
|
// 读取内容
|
||||||
byte[] content = fileService.getFileContent(configId, path);
|
byte[] content = fileService.getFileContent(configId, path);
|
||||||
|
|||||||
Reference in New Issue
Block a user