fix(系统设置): 修改用户登陆日志的记录模块

This commit is contained in:
wxg0103 2024-02-04 14:27:04 +08:00 committed by Craftsman
parent c3a605e99f
commit 8d729e3ea4
1 changed files with 2 additions and 3 deletions

View File

@ -19,7 +19,6 @@ import io.metersphere.system.dto.user.UserDTO;
import io.metersphere.system.dto.user.UserExcludeOptionDTO;
import io.metersphere.system.dto.user.UserRolePermissionDTO;
import io.metersphere.system.dto.user.UserRoleResourceDTO;
import io.metersphere.system.log.constants.OperationLogModule;
import io.metersphere.system.log.constants.OperationLogType;
import io.metersphere.system.log.dto.LogDTO;
import io.metersphere.system.log.service.OperationLogService;
@ -121,7 +120,7 @@ public class UserLoginService {
OperationLogConstants.SYSTEM,
userId,
type,
OperationLogModule.SETTING_SYSTEM,
OperationLogConstants.SYSTEM,
StringUtils.join(user.getName(), StringUtils.EMPTY, content));
dto.setMethod(method);
dto.setPath(path);
@ -367,7 +366,7 @@ public class UserLoginService {
// last organization id 变了
if (user.getLastOrganizationId() != null && !StringUtils.equals(user.getLastOrganizationId(), userFromDB.getLastOrganizationId())) {
List<Project> projects = getProjectListByWsAndUserId(user.getId(), user.getLastOrganizationId());
if (projects.size() > 0) {
if (!projects.isEmpty()) {
// 如果传入的 last_project_id last_organization_id 下面的
boolean present = projects.stream().anyMatch(p -> StringUtils.equals(p.getId(), user.getLastProjectId()));
if (!present) {