师兄,你修改支付授信息后,发起支付时,页面错误提示已经由"数据库无此openid" 变成了404了. 这也是什么原因啊,视频中没有提到会遇见这个情况呀.
以上是我的配置截图




@Controller
//@RequestMapping("/pay") //错误在此,多一层路径,导致访问 http://xsell.natapp1.cc/pay 出现404
public class PayController {
@Autowired
private OrderService orderService;
@Autowired
private PayService payService;
/**
* 微信支付帐号借用
* 前端支付地址调用回调
* @param openid 师兄干货处获取的openid
* @param orderId 订单id
* @param returnUrl 支付完返回地址
* @param map 后端支付页面动态参数
* @return 用户支付页面调用
*/
@GetMapping("/pay")
public ModelAndView index(@RequestParam("openid") String openid,
@RequestParam("orderId") String orderId,
@RequestParam("returnUrl") String returnUrl,
Map<String, Object> map) {
return create(orderId, returnUrl, map);
}
@GetMapping("/pay/create")
public ModelAndView create(@RequestParam("orderId") String orderId,
@RequestParam("returnUrl") String returnUrl,
Map<String, Object> map) {
//1. 查询订单
OrderDTO one = orderService.findOne(orderId);
if (one == null) {
throw new SellExecption(ResultTypeInfoEnum.ORDER_NOT_EXIST);
}
//2.发起支付
PayResponse payResponse = payService.create(one);
map.put("payResponse", payResponse);
map.put("returnUrl", returnUrl);
return new ModelAndView("pay/create", map);
}
}