Commit 68a10ac9 authored by tyn's avatar tyn

Merge branch 'master' of http://47.105.106.177:66/root/sup-server

parents 9f4ff485 bc3be17e
This diff is collapsed.
...@@ -12,11 +12,13 @@ import com.supServer.framework.web.domain.AjaxResult; ...@@ -12,11 +12,13 @@ import com.supServer.framework.web.domain.AjaxResult;
import com.supServer.project.entity.UserInfo; import com.supServer.project.entity.UserInfo;
import com.supServer.project.entity.vo.ForgotPasswordVo; import com.supServer.project.entity.vo.ForgotPasswordVo;
import com.supServer.project.entity.vo.UserResetPwdVo; import com.supServer.project.entity.vo.UserResetPwdVo;
import com.supServer.project.mapper.UserInfoMapper;
import com.supServer.project.service.SmsService; import com.supServer.project.service.SmsService;
import com.supServer.project.service.UserInfoService; import com.supServer.project.service.UserInfoService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -63,6 +65,10 @@ public class UserController { ...@@ -63,6 +65,10 @@ public class UserController {
if(userInfo.getAccountStatus().equals("3")){ if(userInfo.getAccountStatus().equals("3")){
return AjaxResult.error("当前账号已注销"); return AjaxResult.error("当前账号已注销");
} }
String oldPassword = BCrypt.hashpw(loginBody.getPassword(), userInfo.getPassword());
if (!oldPassword.equals(userInfo.getPassword())) {
return AjaxResult.error("密码错误");
}
//AesUtil.decode(loginBody.getUserName()),AesUtil.decode(loginBody.getPassword()),loginBody.getCode(),loginBody.getUuid(),loginBody.getType() //AesUtil.decode(loginBody.getUserName()),AesUtil.decode(loginBody.getPassword()),loginBody.getCode(),loginBody.getUuid(),loginBody.getType()
String token = userLoginService.login(loginBody.getUserName(),loginBody.getPassword(),loginBody.getCode(),loginBody.getUuid()); String token = userLoginService.login(loginBody.getUserName(),loginBody.getPassword(),loginBody.getCode(),loginBody.getUuid());
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
......
...@@ -112,7 +112,7 @@ public class UserInfoServiceImpl implements UserInfoService { ...@@ -112,7 +112,7 @@ public class UserInfoServiceImpl implements UserInfoService {
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
UserInfo userInfoToken = loginUser.getUser(); UserInfo userInfoToken = loginUser.getUser();
// 查询最新的数据 // 查询最新的数据
UserInfo userInfo = userInfoMapper.selectUserByUserName(userInfoToken.getUserName()); UserInfo userInfo = userInfoMapper.selectUserByUserName(userInfoToken.getPhone());
// 原密码 // 原密码
String oldPassword = BCrypt.hashpw(userInfoVo.getOldPassword(), userInfo.getPassword()); String oldPassword = BCrypt.hashpw(userInfoVo.getOldPassword(), userInfo.getPassword());
if (!oldPassword.equals(userInfo.getPassword())) { if (!oldPassword.equals(userInfo.getPassword())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment