mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-10-29 02:57:11 +08:00
chore: 优化登录日志描述
This commit is contained in:
@@ -30,6 +30,7 @@ import org.springframework.http.HttpHeaders;
|
|||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import top.continew.admin.auth.enums.AuthTypeEnum;
|
import top.continew.admin.auth.enums.AuthTypeEnum;
|
||||||
import top.continew.admin.auth.model.req.AccountLoginReq;
|
import top.continew.admin.auth.model.req.AccountLoginReq;
|
||||||
|
import top.continew.admin.auth.model.req.LoginReq;
|
||||||
import top.continew.admin.common.constant.SysConstants;
|
import top.continew.admin.common.constant.SysConstants;
|
||||||
import top.continew.admin.system.enums.LogStatusEnum;
|
import top.continew.admin.system.enums.LogStatusEnum;
|
||||||
import top.continew.admin.system.mapper.LogMapper;
|
import top.continew.admin.system.mapper.LogMapper;
|
||||||
@@ -146,6 +147,7 @@ public class LogDaoLocalImpl implements LogDao {
|
|||||||
// 解析登录接口信息
|
// 解析登录接口信息
|
||||||
if (requestUri.startsWith(SysConstants.LOGIN_URI) && LogStatusEnum.SUCCESS.equals(logDO.getStatus())) {
|
if (requestUri.startsWith(SysConstants.LOGIN_URI) && LogStatusEnum.SUCCESS.equals(logDO.getStatus())) {
|
||||||
String requestBody = logRequest.getBody();
|
String requestBody = logRequest.getBody();
|
||||||
|
logDO.setDescription(JSONUtil.toBean(requestBody, LoginReq.class).getAuthType().getDescription() + "登录");
|
||||||
// 解析账号登录用户为操作人
|
// 解析账号登录用户为操作人
|
||||||
if (requestBody.contains(AuthTypeEnum.ACCOUNT.getValue())) {
|
if (requestBody.contains(AuthTypeEnum.ACCOUNT.getValue())) {
|
||||||
AccountLoginReq authReq = JSONUtil.toBean(requestBody, AccountLoginReq.class);
|
AccountLoginReq authReq = JSONUtil.toBean(requestBody, AccountLoginReq.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user