From edce0168e77ea0dc1410b3da3161683586ed316c Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 6 Jun 2022 16:37:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=A3=80=E6=9F=A5=E6=98=AF=E5=90=A6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/mapper/ext/ExtOperatingLogMapper.java | 2 +- .../base/mapper/ext/ExtOperatingLogMapper.xml | 4 ++++ .../main/java/io/metersphere/service/UserService.java | 9 +++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.java index 1a766b059b..74453ca396 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.java @@ -14,5 +14,5 @@ public interface ExtOperatingLogMapper { List findBySourceIdEnv(@Param("request") OperatingLogRequest request); - + boolean isNewInstallation(); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml index ef078d05fb..bf75792c39 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtOperatingLogMapper.xml @@ -128,4 +128,8 @@ LEFT JOIN project t2 ON tt.project_id = t2.id order by tt.oper_time desc + + diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index 925718e6bd..a9a5388180 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.*; -import io.metersphere.base.mapper.ext.ExtProjectMapper; -import io.metersphere.base.mapper.ext.ExtUserGroupMapper; -import io.metersphere.base.mapper.ext.ExtUserMapper; -import io.metersphere.base.mapper.ext.ExtWorkspaceMapper; +import io.metersphere.base.mapper.ext.*; import io.metersphere.commons.constants.*; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.user.SessionUser; @@ -94,7 +91,7 @@ public class UserService { @Resource private ExtWorkspaceMapper extWorkspaceMapper; @Resource - private OperatingLogMapper operatingLogMapper; + private ExtOperatingLogMapper extOperatingLogMapper; public List queryTypeByIds(List userIds) { return extUserMapper.queryTypeByIds(userIds); @@ -1356,7 +1353,7 @@ public class UserService { public boolean checkWhetherChangePasswordOrNot(LoginRequest request) { // 首次登录需要提示 - if (operatingLogMapper.countByExample(new OperatingLogExample()) == 0) { + if (extOperatingLogMapper.isNewInstallation()) { return true; }