From 4b6b245be697c242fe9abbf1dcc356cd800df58c Mon Sep 17 00:00:00 2001 From: gongzhenkun <1658878546@qq.com> Date: Fri, 19 Aug 2022 16:25:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BB=E7=94=9F=E8=AF=81=E4=B9=A6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/file/FileUtils.java | 4 ++++ .../java/com/ruoyi/framework/web/service/SysLoginService.java | 4 ---- .../java/com/ruoyi/system/service/impl/WechatServiceImpl.java | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index 164885e..3556ee1 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -322,6 +322,10 @@ public class FileUtils { Base64.Decoder decoder = Base64.getDecoder(); + if (imgStr.contains("data:image/jpeg;base64,")) { + // 去掉base64前缀 data:image/jpeg;base64, + imgStr = imgStr.substring(imgStr.indexOf(",", 1) + 1); + } try { //Base64解码 diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index ca68bb0..a973633 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -149,10 +149,6 @@ public class SysLoginService } public AjaxResult loginForAppFillInfo(AppRegisterReq req) { - if (StringUtils.isNotEmpty(req.getMedicalLicense())) { - log.info("MedicalLicense is not null."); - req.setMedicalLicense(FileUtils.GenerateImage(req.getMedicalLicense())); - } log.info("login for app fill info req :{}", req); // 查询sys_user数据 SysUser sysUser = userService.selectUserByPhone(req.getPhone()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java index d07bcb1..e73a1b8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/WechatServiceImpl.java @@ -151,9 +151,6 @@ public class WechatServiceImpl implements IWechatService { public String loginForApp(LoginForAppReq req) { // 查询手机号是否存在医生信息 TDoctor tDoctor = new TDoctor(); - if (StringUtils.isNotEmpty(req.getMedicalLicense())) { - req.setMedicalLicense(FileUtils.GenerateImage(req.getMedicalLicense())); - } BeanUtils.copyProperties(req, tDoctor); TDoctor currentDoctor = tDoctorMapper.selectTDoctorByPhone(req.getPhone()); TWechatUser wechatUser = new TWechatUser();