From d74ac7a9b03127c93ae1f49793c1365a05ecc9f2 Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Mon, 7 Nov 2022 09:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bar=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=B5=8B=E5=80=BC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/api/AppController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java index 536e289..a3f6cc2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/AppController.java @@ -715,11 +715,11 @@ public class AppController extends BaseController for (Map.Entry entry : ((JSONObject) obj).entrySet()) { // 如果key包含在图片 if (imageKeys.contains(entry.getKey())) { - System.out.println(entry.getKey()); String imageStr = null; String imageKey = null; if (entry.getValue() instanceof JSONObject) { - if (null != ((JSONObject) entry.getValue()).getString("bar")) { + logger.info("entry key is {}", entry.getKey()); + if (entry.getKey().contains("avg")) { imageStr = ((JSONObject) entry.getValue()).getString("bar"); imageKey = "bar"; } else { @@ -727,8 +727,9 @@ public class AppController extends BaseController imageKey = "v"; } } - if (null != imageStr && !"".equals(imageStr) && null != imageKey && !"".equals(imageKey)) { + if (null != imageStr && !"".equals(imageStr)) { // 将base64转为图片存在服务器,并将返回值置空 + logger.info("image name is '{}', image str is '{}'", entry.getKey(), imageStr); String path = FileUtils.GenerateImage(imageStr, entry.getKey()); TImage tImage = new TImage(); tImage.setName(entry.getKey());