updates
This commit is contained in:
parent
0e0b01055c
commit
00efbf53f9
|
|
@ -30,7 +30,7 @@ public class IpUtils {
|
|||
if (StringUtils.isEmpty(ip) || CommonConstant.UNKNOWN.equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("Proxy-Client-IP");
|
||||
}
|
||||
if (StringUtils.isEmpty(ip) || ip.length() == 0 ||CommonConstant.UNKNOWN.equalsIgnoreCase(ip)) {
|
||||
if (StringUtils.isEmpty(ip) || ip.isEmpty() ||CommonConstant.UNKNOWN.equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("WL-Proxy-Client-IP");
|
||||
}
|
||||
if (StringUtils.isEmpty(ip) || CommonConstant.UNKNOWN.equalsIgnoreCase(ip)) {
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public class BaseCommonServiceImpl implements BaseCommonService {
|
|||
HttpServletRequest request = SpringContextUtils.getHttpServletRequest();
|
||||
//设置IP地址
|
||||
sysLog.setIp(IpUtils.getIpAddr(request));
|
||||
System.out.println("IP地址:"+ sysLog.getIp());
|
||||
} catch (Exception e) {
|
||||
sysLog.setIp("127.0.0.1");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ public class WebUserController {
|
|||
|
||||
@RequestMapping(value = "register",method = RequestMethod.POST)
|
||||
@ApiOperation(value = "账号注册")
|
||||
@AutoLog(value = "网站前台-账号注册")
|
||||
public Result<?> register(@RequestBody SysLoginModel sysLoginModel, HttpServletRequest request){
|
||||
String ipAddr = IpUtils.getIpAddr(request);
|
||||
String phone = sysLoginModel.getPhone();
|
||||
|
|
@ -80,7 +79,6 @@ public class WebUserController {
|
|||
|
||||
@RequestMapping(value = "passwordChanger",method = RequestMethod.POST)
|
||||
@ApiOperation(value = "更改密码")
|
||||
@AutoLog(value = "网站前台-更改密码")
|
||||
public Result<?> passwordChanger(@RequestBody SysLoginModel sysLoginModel, HttpServletRequest request){
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String oldPassword = sysLoginModel.getOldPassword();//输入的旧密码
|
||||
|
|
@ -113,7 +111,6 @@ public class WebUserController {
|
|||
|
||||
@RequestMapping(value = "/login/passwd", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "手机号密码登录")
|
||||
@AutoLog(value = "网站前台-账号登录")
|
||||
public Result<?> loginPasswd(@RequestBody SysLoginModel sysLoginModel){
|
||||
return webUserService.loginPasswd(sysLoginModel);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.jeecg.common.system.vo.LoginUser;
|
|||
import org.jeecg.common.util.AssertUtils;
|
||||
import org.jeecg.common.util.PasswordUtil;
|
||||
import org.jeecg.common.util.RedisUtil;
|
||||
import org.jeecg.modules.base.service.BaseCommonService;
|
||||
import org.jeecg.modules.mini.dto.VipDTO;
|
||||
import org.jeecg.modules.mini.service.MiniUserService;
|
||||
import org.jeecg.modules.system.entity.SysUser;
|
||||
|
|
@ -37,6 +38,8 @@ public class WebUserService {
|
|||
@Resource
|
||||
private MiniUserService miniUserService;
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
/**
|
||||
|
|
@ -64,6 +67,8 @@ public class WebUserService {
|
|||
JSONObject obj = new JSONObject();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
BeanUtils.copyProperties(sysUser, loginUser);
|
||||
//添加日志
|
||||
baseCommonService.addLog("前台用户登录:用户名: " + sysUser.getUsername() + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
|
||||
//获取vip信息
|
||||
VipDTO vipDTO = miniUserService.getUserVip(sysUser.getId());
|
||||
if (vipDTO != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue