Skip to content

Commit

Permalink
修复多仓 (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
power721 authored Jan 18, 2025
1 parent 10ae025 commit da8c17f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/base_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
742.2121
750.1002
Binary file modified data/data.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ private void validate(FileDto dto) {
}
dto.setPath(new File(dto.getDir(), dto.getName()).getAbsolutePath());
if (dto.getName().endsWith(".json")) {
try {
var node = objectMapper.readTree(dto.getContent());
dto.setContent(objectMapper.writeValueAsString(node));
} catch (IOException e) {
throw new BadRequestException("JSON格式错误", e);
if (StringUtils.isNotBlank(dto.getContent())) {
try {
var node = objectMapper.readTree(dto.getContent());
dto.setContent(objectMapper.writeValueAsString(node));
} catch (IOException e) {
throw new BadRequestException("JSON格式错误", e);
}
} else if ("null".equals(dto.getContent())) {
dto.setContent("");
}
}
}
Expand Down

0 comments on commit da8c17f

Please sign in to comment.