From 4c2e8fc8bdb5fa2ef0f0b02aa745e38725a1227e Mon Sep 17 00:00:00 2001 From: Guaning <1499612906@qq.com> Date: Tue, 14 Jan 2025 12:20:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E7=99=BB=E5=BD=95=EF=BC=8C=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=AF=B9=E5=BA=94=E6=97=A5=E5=BF=97=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=93=8D=E4=BD=9C=E4=BA=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../continew/admin/config/log/LogDaoLocalImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/continew-webapi/src/main/java/top/continew/admin/config/log/LogDaoLocalImpl.java b/continew-webapi/src/main/java/top/continew/admin/config/log/LogDaoLocalImpl.java index b9808e20..61d8e2a7 100644 --- a/continew-webapi/src/main/java/top/continew/admin/config/log/LogDaoLocalImpl.java +++ b/continew-webapi/src/main/java/top/continew/admin/config/log/LogDaoLocalImpl.java @@ -29,8 +29,7 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpHeaders; import org.springframework.scheduling.annotation.Async; import top.continew.admin.auth.enums.AuthTypeEnum; -import top.continew.admin.auth.model.req.AccountLoginReq; -import top.continew.admin.auth.model.req.LoginReq; +import top.continew.admin.auth.model.req.*; import top.continew.admin.common.constant.SysConstants; import top.continew.admin.system.enums.LogStatusEnum; import top.continew.admin.system.mapper.LogMapper; @@ -154,6 +153,16 @@ public class LogDaoLocalImpl implements LogDao { logDO.setCreateUser(ExceptionUtils.exToNull(() -> userService.getByUsername(authReq.getUsername()) .getId())); return; + } else if (requestBody.contains(AuthTypeEnum.EMAIL.getValue())) { + EmailLoginReq authReq = JSONUtil.toBean(requestBody, EmailLoginReq.class); + logDO.setCreateUser(ExceptionUtils.exToNull(() -> userService.getByEmail(authReq.getEmail()) + .getId())); + return; + } else if (requestBody.contains(AuthTypeEnum.PHONE.getValue())) { + PhoneLoginReq authReq = JSONUtil.toBean(requestBody, PhoneLoginReq.class); + logDO.setCreateUser(ExceptionUtils.exToNull(() -> userService.getByPhone(authReq.getPhone()) + .getId())); + return; } } // 解析 Token 信息 -- Gitee