|
@@ -40,13 +40,17 @@ public class PushServiceImpl implements PushService {
|
|
|
return;
|
|
|
}
|
|
|
JSONObject jsonObject = JSONObject.parseObject(faceLog);
|
|
|
- String photo = jsonObject.getString("photo");
|
|
|
- String imgBase64 = getImgBase64(photo);
|
|
|
String sfzPhoto = jsonObject.getString("sfzPhoto");
|
|
|
- String sfzImgBase64 = getImgBase64(sfzPhoto);
|
|
|
+ if (StringUtils.isNotBlank(sfzPhoto)){
|
|
|
+ String sfzImgBase64 = getImgBase64(sfzPhoto);
|
|
|
+ jsonObject.put("sfzPhoto", sfzImgBase64);
|
|
|
+ }
|
|
|
+ String photo = jsonObject.getString("photo");
|
|
|
+ if (StringUtils.isNotBlank(photo)){
|
|
|
+ String imgBase64 = getImgBase64(photo);
|
|
|
+ jsonObject.put("photo", imgBase64);
|
|
|
+ }
|
|
|
Integer adminId = jsonObject.getInteger("adminId");
|
|
|
- jsonObject.put("photo", imgBase64);
|
|
|
- jsonObject.put("sfzPhoto", sfzImgBase64);
|
|
|
jsonObject.remove("adminId");
|
|
|
jsonObject.remove("userId");
|
|
|
log.info("数据推送前;{}", jsonObject);
|
|
@@ -89,8 +93,10 @@ public class PushServiceImpl implements PushService {
|
|
|
jsonObject.remove("adminId");
|
|
|
String phone = jsonObject.getString("phone");
|
|
|
String avatar = jsonObject.getString("avatar");
|
|
|
- String imgBase64 = getImgBase64(avatar);
|
|
|
- jsonObject.put("avatar", imgBase64);
|
|
|
+ if (StringUtils.isNotBlank(avatar)){
|
|
|
+ String imgBase64 = getImgBase64(avatar);
|
|
|
+ jsonObject.put("avatar", imgBase64);
|
|
|
+ }
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("data", jsonObject);
|
|
|
log.info("数据推送后;{}", json);
|