From d6a494c891d90c17e62e3c5dbb71e0d55f60fba7 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 17 Feb 2022 14:22:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=AF=86=E7=A0=81=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/service/UserService.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index 8f66962027..985437c816 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -33,12 +33,9 @@ import io.metersphere.excel.listener.EasyExcelListener; import io.metersphere.excel.listener.UserDataListener; import io.metersphere.excel.utils.EasyExcelExporter; import io.metersphere.i18n.Translator; -import io.metersphere.log.service.OperatingLogService; import io.metersphere.log.utils.ReflexObjectUtil; import io.metersphere.log.vo.DetailColumn; -import io.metersphere.log.vo.OperatingLogDTO; import io.metersphere.log.vo.OperatingLogDetails; -import io.metersphere.log.vo.OperatingLogRequest; import io.metersphere.log.vo.system.SystemReference; import io.metersphere.notice.domain.UserDetail; import io.metersphere.security.MsUserToken; @@ -98,7 +95,7 @@ public class UserService { @Resource private ExtWorkspaceMapper extWorkspaceMapper; @Resource - private OperatingLogService operatingLogService; + private OperatingLogMapper operatingLogMapper; public List queryTypeByIds(List userIds) { return extUserMapper.queryTypeByIds(userIds); @@ -530,7 +527,7 @@ public class UserService { String oldPassword = CodingUtil.md5(request.getPassword(), "utf-8"); String newPassword = request.getNewpassword(); String newPasswordMd5 = CodingUtil.md5(newPassword); - if(StringUtils.equals(oldPassword,newPasswordMd5)){ + if (StringUtils.equals(oldPassword, newPasswordMd5)) { return null; } UserExample userExample = new UserExample(); @@ -1290,6 +1287,7 @@ public class UserService { /** * 根据userId 获取 user 所属工作空间和所属工作项目 + * * @param userId */ public Map getWSAndProjectByUserId(String userId) { @@ -1302,9 +1300,8 @@ public class UserService { } public boolean checkWhetherChangePasswordOrNot(LoginRequest request) { - List list = operatingLogService.list(new OperatingLogRequest()); // 首次登录需要提示 - if (CollectionUtils.isEmpty(list)) { + if (operatingLogMapper.countByExample(new OperatingLogExample()) == 0) { return true; }