|
@@ -63,16 +63,20 @@ public class GkaqFormAuthenticationFilter extends FormAuthenticationFilter {
|
|
|
String clientIp = IpUtil.getIpAddr(httpRequest);
|
|
|
session.setAttribute(Constants.SESSION_KEY_IP, clientIp);
|
|
|
|
|
|
- // 数据库日志
|
|
|
- SysLogModel log = new SysLogModel();
|
|
|
- log.setLogType(Constants.LOG_TYPE_3);
|
|
|
- log.setLogPath(GkaqFormAuthenticationFilter.class.getName());
|
|
|
- log.setLogParam("");
|
|
|
- log.setLogMsg("用户:[" + user.getLoginName() + "|" + user.getRealName() + "]登入系统!");
|
|
|
- log.setClientIp(clientIp);
|
|
|
- // 保存数据库
|
|
|
- sysLogService.save(log);
|
|
|
- logger.info("生成系统日志[日志描述:{},客户端IP:{}]", log.getLogMsg(), clientIp);
|
|
|
+ try {
|
|
|
+ // 数据库日志
|
|
|
+ SysLogModel log = new SysLogModel();
|
|
|
+ log.setLogType(Constants.LOG_TYPE_3);
|
|
|
+ log.setLogPath(GkaqFormAuthenticationFilter.class.getName());
|
|
|
+ log.setLogParam("");
|
|
|
+ log.setLogMsg("用户:[" + user.getLoginName() + "|" + user.getRealName() + "]登入系统!");
|
|
|
+ log.setClientIp(clientIp);
|
|
|
+ // 保存数据库
|
|
|
+ sysLogService.save(log);
|
|
|
+ logger.info("生成系统日志[日志描述:{},客户端IP:{}]", log.getLogMsg(), clientIp);
|
|
|
+ } catch (Exception ex) {
|
|
|
+ logger.error("生成系统日志发生异常:", ex);
|
|
|
+ }
|
|
|
return super.onLoginSuccess(token, subject, request, response);
|
|
|
}
|
|
|
|