main
parent
0deb9a9f79
commit
055db240c8
|
|
@ -475,12 +475,7 @@ public class PayController extends BaseController
|
||||||
|
|
||||||
@PostMapping(value = "/aliPay")
|
@PostMapping(value = "/aliPay")
|
||||||
@ApiOperation(value = "支付宝支付", notes = "支付宝支付", httpMethod = "POST")
|
@ApiOperation(value = "支付宝支付", notes = "支付宝支付", httpMethod = "POST")
|
||||||
public String aliPay(@RequestBody AppOrderArg appOrderArg,HttpServletResponse response) {
|
public String aliPay(@RequestBody AppOrderArg appOrderArg) throws Exception{
|
||||||
// 需要指定response的ContentType为流式输出,且字符编码为UTF-8
|
|
||||||
// response.setContentType("application/x-www-form-urlencoded");
|
|
||||||
response.setCharacterEncoding("UTF-8");
|
|
||||||
// 禁用缓存
|
|
||||||
response.setHeader("Cache-Control", "no-cache");
|
|
||||||
String orderNo = KeyUtil.generateUniqueKey();
|
String orderNo = KeyUtil.generateUniqueKey();
|
||||||
AlipayTradeCreateResponse result = null;
|
AlipayTradeCreateResponse result = null;
|
||||||
try {
|
try {
|
||||||
|
|
@ -499,7 +494,8 @@ public class PayController extends BaseController
|
||||||
order.setCreateTime(new Date());
|
order.setCreateTime(new Date());
|
||||||
order.setLevel(appOrderArg.getLevel());
|
order.setLevel(appOrderArg.getLevel());
|
||||||
appOrderMapper.insertAppOrder(order);
|
appOrderMapper.insertAppOrder(order);
|
||||||
return result.getBody().toString();
|
String nodeStr = new String(result.getBody().getBytes("UTF-8"), "UTF-8");
|
||||||
|
return nodeStr;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue