| | |
| | | package com.ycl.jxkg.config.spring.security; |
| | | |
| | | import com.ycl.jxkg.base.SystemCode; |
| | | import com.ycl.jxkg.domain.UserEventLog; |
| | | import com.ycl.jxkg.domain.entity.UserEventLog; |
| | | import com.ycl.jxkg.event.UserEvent; |
| | | import com.ycl.jxkg.service.UserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | Object object = authentication.getPrincipal(); |
| | | if (null != object) { |
| | | User springUser = (User) object; |
| | | com.ycl.jxkg.domain.User user = userService.getUserByUserName(springUser.getUsername()); |
| | | com.ycl.jxkg.domain.entity.User user = userService.getUserByUserName(springUser.getUsername()); |
| | | if (null != user) { |
| | | UserEventLog userEventLog = new UserEventLog(user.getId(), user.getUserName(), user.getRealName(), new Date()); |
| | | userEventLog.setContent(user.getUserName() + " 登录了学之思开源考试系统"); |
| | | userEventLog.setContent(user.getUserName() + " 登录了江西语音视频培训系统"); |
| | | eventPublisher.publishEvent(new UserEvent(userEventLog)); |
| | | com.ycl.jxkg.domain.User newUser = new com.ycl.jxkg.domain.User(); |
| | | com.ycl.jxkg.domain.entity.User newUser = new com.ycl.jxkg.domain.entity.User(); |
| | | newUser.setUserName(user.getUserName()); |
| | | newUser.setImagePath(user.getImagePath()); |
| | | RestUtil.response(response, SystemCode.OK.getCode(), SystemCode.OK.getMessage(), newUser); |