fix: writeValueAsString异常处理
This commit is contained in:
@@ -118,10 +118,11 @@ public class SitePagesController {
|
||||
@SuppressWarnings("unchecked")
|
||||
var entries = (List<Map<String, Object>>) payload.get("entries");
|
||||
sitePagesService.savePages("default:" + type, entries != null ? entries : List.of());
|
||||
String json = payload.containsKey("entries")
|
||||
? new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(entries)
|
||||
: "[]";
|
||||
storageService.store("pages/default/" + type + ".json", json);
|
||||
try {
|
||||
String json = entries != null
|
||||
? new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(entries) : "[]";
|
||||
storageService.store("pages/default/" + type + ".json", json);
|
||||
} catch (Exception ignored) {}
|
||||
return ApiResponse.success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user