mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +08:00 
			
		
		
		
	fix(system/log): 修复邮箱登录,手机号登录对应日志没有记录操作人问题
This commit is contained in:
		| @@ -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 信息 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user