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