添加支付密码

This commit is contained in:
韩鹏辉
2024-05-23 09:57:35 +08:00
parent 7c5e40cd38
commit 3087146696
2 changed files with 17 additions and 3 deletions

View File

@@ -58,9 +58,10 @@ public class PayController {
@GetMapping("accountPay") @GetMapping("accountPay")
public Result accountPay(@RequestHeader("token") String token, public Result accountPay(@RequestHeader("token") String token,
@RequestParam("orderId") String orderId, @RequestParam("orderId") String orderId,
@RequestParam("memberId") String memberId @RequestParam("memberId") String memberId,
@RequestParam("pwd") String pwd
) { ) {
return payService.accountPay(orderId, memberId, token); return payService.accountPay(orderId, memberId, token,pwd);
} }
@RequestMapping("groupOrderPay") @RequestMapping("groupOrderPay")

View File

@@ -294,7 +294,7 @@ public class PayService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Result accountPay(String orderId, String memberId, String token) { public Result accountPay(String orderId, String memberId, String token,String pwd) {
if (ObjectUtil.isEmpty(orderId) || ObjectUtil.isEmpty(memberId)) { if (ObjectUtil.isEmpty(orderId) || ObjectUtil.isEmpty(memberId)) {
return Result.fail("参数错误"); return Result.fail("参数错误");
} }
@@ -305,6 +305,19 @@ public class PayService {
} }
TbUserInfo userInfo= tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getUserId()));
if(ObjectUtil.isEmpty(userInfo)){
return Result.fail("未获取到用户信息");
}
if(!userInfo.getPwd().equals(MD5Utils.md5(pwd))){
return Result.fail("支付密码错误");
}
if (!"unpaid".equals(orderInfo.getStatus()) && !"paying".equals(orderInfo.getStatus()) ) { if (!"unpaid".equals(orderInfo.getStatus()) && !"paying".equals(orderInfo.getStatus()) ) {
return Result.fail("订单出状态异常"); return Result.fail("订单出状态异常");
} }