From 07b6b55409b369407ca78a8f4b80bf4276e715ca Mon Sep 17 00:00:00 2001 From: wangpeng Date: Fri, 17 May 2024 11:19:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E8=84=B8=E8=AF=86=E5=88=AB=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/controller/eduApp/AppUsersCacheController.java | 5 +++++ src/main/java/com/zcloud/util/Base64Util.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zcloud/controller/eduApp/AppUsersCacheController.java b/src/main/java/com/zcloud/controller/eduApp/AppUsersCacheController.java index 6160faa..e1074b2 100644 --- a/src/main/java/com/zcloud/controller/eduApp/AppUsersCacheController.java +++ b/src/main/java/com/zcloud/controller/eduApp/AppUsersCacheController.java @@ -192,6 +192,9 @@ public class AppUsersCacheController extends BaseController { } MultipartFile coverpath = ImageUtil.getMultipartFile(Const.HTTPFILEURL + user.getString("COVERPATH")); String USERAVATARURL = Base64Util.getBase64String(coverpath); + System.out.println("---------------------------------------------------"); + System.out.println(pd.getString("USERAVATARURL")); + System.out.println("---------------------------------------------------"); try { String confidence = FaceUtil.compareFace(pd.getString("USERAVATARURL"), USERAVATARURL); @@ -221,8 +224,10 @@ public class AppUsersCacheController extends BaseController { initPageDataUtil.initSaveApp(faceImg, pd.getString("USER_ID")); // faceImg.put("IS_SUCCESS", 0); faceImgLogService.save(faceImg); + map.put("result", errInfo); } + return map; } catch (Exception e) { System.out.println("----------" + e.getMessage()); diff --git a/src/main/java/com/zcloud/util/Base64Util.java b/src/main/java/com/zcloud/util/Base64Util.java index d2f3980..1af8ab1 100644 --- a/src/main/java/com/zcloud/util/Base64Util.java +++ b/src/main/java/com/zcloud/util/Base64Util.java @@ -11,7 +11,7 @@ public class Base64Util { String baseStr = null; BASE64Encoder encoder = new BASE64Encoder(); baseStr = encoder.encode(multiPartFile.getBytes()); - baseStr = baseStr.replaceAll("\r\n", ""); + baseStr = baseStr.replaceAll("\\r|\\n", ""); return baseStr; } }