mirror of https://gitee.com/xiaonuobase/snowy
【修复】 站内信详情中包含删除用户无法正常显示为“未知用户”
站内信收件人中包含已删除用户时,sysUserApi.getUserByIdWithException(devRelation.getTargetId())方法会抛出异常,直接抛到前端报错,这里捕获一下异常不做处理,可以让删除用户成功显示为未知用户或者在catch中做特殊处理 Signed-off-by: wxwx <4622811@163.com>pull/230/head
parent
978ab81463
commit
8f7424b5e7
|
@ -192,7 +192,13 @@ public class DevMessageServiceImpl extends ServiceImpl<DevMessageMapper, DevMess
|
|||
List<DevMessageResult.DevReceiveInfo> receiveInfoList = devRelationService.getRelationListByObjectIdAndCategory(devMessage.getId(),
|
||||
DevRelationCategoryEnum.MSG_TO_USER.getValue()).stream().map(devRelation -> {
|
||||
DevMessageResult.DevReceiveInfo devReceiveInfo = new DevMessageResult.DevReceiveInfo();
|
||||
JSONObject userObj = sysUserApi.getUserByIdWithException(devRelation.getTargetId());
|
||||
JSONObject userObj = null;
|
||||
try {
|
||||
userObj = sysUserApi.getUserByIdWithException(devRelation.getTargetId());
|
||||
}
|
||||
catch (Exception e) {
|
||||
// 收件人中包含删除用户 在此处做处理
|
||||
}
|
||||
String userName = "未知用户";
|
||||
if(ObjectUtil.isNotEmpty(userObj)) {
|
||||
userName = userObj.getStr("name");
|
||||
|
|
Loading…
Reference in New Issue