fix(接口测试): 修复node执行完成后发通知获取用户异常

--bug=1020354 --user=赵勇 [接口测试]项目接口测试开启使用k8s/local资源池,在接口定义-case-执行case成功,但是后台日志报错 https://www.tapd.cn/55049933/s/1306221
This commit is contained in:
fit2-zhao 2022-11-28 13:58:51 +08:00
parent 40f7049efd
commit c7a0393e90
1 changed files with 2 additions and 6 deletions

View File

@ -172,12 +172,8 @@ public class ApiDefinitionExecResultService {
event = NoticeConstants.Event.EXECUTE_FAILED;
status = "失败";
}
if (user == null) {
if (SessionUtils.getUser() != null && StringUtils.equals(SessionUtils.getUser().getId(), result.getUserId())) {
user = SessionUtils.getUser();
} else {
user = userMapper.selectByPrimaryKey(result.getUserId());
}
if (user == null && StringUtils.isNotBlank(result.getUserId())) {
user = userMapper.selectByPrimaryKey(result.getUserId());
}
Map paramMap = new HashMap<>(beanMap);
paramMap.put("operator", user != null ? user.getName() : result.getUserId());