| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.jilongda.applet.security.SecurityUserDetails; |
| | | import com.jilongda.applet.security.SysUserDetailsService; |
| | | import com.jilongda.applet.service.LoginLogService; |
| | | import com.jilongda.common.log.OperLoginLog; |
| | | import com.jilongda.common.log.ParamParser; |
| | |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.authentication.AnonymousAuthenticationToken; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Autowired |
| | | private LoginLogService loginLogService; |
| | | @Autowired |
| | | private SysUserDetailsService loadUserDetailsService; |
| | | |
| | | /** |
| | | * 设置操作日志切入点 记录登录日志 在注解的位置切入代码 |
| | |
| | | // userName = authentication.getName(); |
| | | // } |
| | | |
| | | if (StringUtils.hasLength(userName)) { |
| | | // if (StringUtils.hasLength(userName)) { |
| | | // 通过用户名查询该账号信息 |
| | | SecurityUserDetails userDetails = loadUserDetailsService.loadUserByUsername(userName); |
| | | // SecurityUserDetails userDetails = loadUserDetailsService.loadUserByUsername(userName); |
| | | // operLoginLog.setUserName(userDetails.getShortName()); // 请求用户名称 |
| | | // operLoginLog.setAccount(userDetails.getAccount()); // 请求账号 |
| | | } |
| | | // } |
| | | String ip = IPUtil.getIpAddress(request); |
| | | operLoginLog.setLoginIp(ip); // 请求IP |
| | | // operLoginLog.setLoginAddress(IPAddressUtil.getRealAddress(ip)); // 登录地址,目前服务器带不动 |