This commit is contained in:
牛叉闪闪
2024-08-30 14:40:43 +08:00
parent 187a757575
commit e0b62b66d4
2 changed files with 24 additions and 22 deletions

View File

@@ -23,6 +23,8 @@ public class LoginContoller {
@Autowired @Autowired
LoginService loginService; LoginService loginService;
@RequestMapping(value = "login",method = RequestMethod.POST) @RequestMapping(value = "login",method = RequestMethod.POST)
public Result login(@RequestBody LoginReq loginReq, HttpServletRequest request){ public Result login(@RequestBody LoginReq loginReq, HttpServletRequest request){
try { try {

View File

@@ -190,28 +190,28 @@ public class MemberService {
} }
if ("1".equals(shopInfo.getIsMemberIn())) { // if ("1".equals(shopInfo.getIsMemberIn())) {
if (!map.containsKey("pwd") || ObjectUtil.isEmpty(map.get("pwd"))) { // if (!map.containsKey("pwd") || ObjectUtil.isEmpty(map.get("pwd"))) {
return Result.fail(CodeEnum.PARAM); // return Result.fail(CodeEnum.PARAM);
} // }
String pwd = map.get("pwd").toString(); // String pwd = map.get("pwd").toString();
String accountId = TokenUtil.parseParamFromToken(token).getString("accountId"); // String accountId = TokenUtil.parseParamFromToken(token).getString("accountId");
//
//
TbmerchantAccount account = tbmerchantAccountMapper.selectByPrimaryKey(Integer.valueOf(accountId)); // TbmerchantAccount account = tbmerchantAccountMapper.selectByPrimaryKey(Integer.valueOf(accountId));
if (Objects.isNull(account)) { // if (Objects.isNull(account)) {
return Result.fail(CodeEnum.ACCOUNTEIXST); // return Result.fail(CodeEnum.ACCOUNTEIXST);
} // }
//
//
if (Objects.isNull(account.getPwd()) || ObjectUtil.isEmpty(account.getPwd())) { // if (Objects.isNull(account.getPwd()) || ObjectUtil.isEmpty(account.getPwd())) {
return Result.fail(CodeEnum.PWDNOSET); // return Result.fail(CodeEnum.PWDNOSET);
} // }
//
if (!account.getPwd().equals(MD5Util.encrypt(pwd.concat(account.getAccount()).concat(account.getId().toString())))) { // if (!account.getPwd().equals(MD5Util.encrypt(pwd.concat(account.getAccount()).concat(account.getId().toString())))) {
return Result.fail(CodeEnum.PWDERROE); // return Result.fail(CodeEnum.PWDERROE);
} // }
} // }
TbShopUser shopUser = tbShopUserMapper.selectByPrimaryKey(Integer.valueOf(memberId)); TbShopUser shopUser = tbShopUserMapper.selectByPrimaryKey(Integer.valueOf(memberId));