代码调整

This commit is contained in:
2023-06-25 09:58:12 +08:00
parent 160604a9d7
commit 4e494e5e8d

View File

@@ -46,7 +46,7 @@ public class DrawPicUtil {
private String drawPic(String option, int width, int height) {
JSONObject jsonObject = new JSONObject();
jsonObject.set("width", width == 0 ? 925 : width);
jsonObject.set("height", height == 0 ? 300 : width);
jsonObject.set("height", height == 0 ? 300 : height);
jsonObject.set("option", JSONUtil.parseObj(option));
ResponseEntity<String> picResult = RestTemplateUtil.post(URL, jsonObject, String.class);
return Objects.requireNonNull(picResult.getBody()).indexOf("image/png") > 0 ? picResult.getBody() : "";