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
LoginService loginService;
@RequestMapping(value = "login",method = RequestMethod.POST)
public Result login(@RequestBody LoginReq loginReq, HttpServletRequest request){
try {

View File

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