From 8d729e3ea4f90fe843fc81eae2a4c3c27f127752 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Sun, 4 Feb 2024 14:27:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E7=99=BB=E9=99=86=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=9A=84=E8=AE=B0=E5=BD=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/system/service/UserLoginService.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserLoginService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserLoginService.java index af6fbf4af5..9deb6318b6 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserLoginService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserLoginService.java @@ -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 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) {