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; }