|
@@ -191,7 +191,7 @@ public class PayController extends HttpServlet {
|
|
return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[解析失败]]></return_msg></xml>";
|
|
return "<xml><return_code><![CDATA[FAIL]]></return_code><return_msg><![CDATA[解析失败]]></return_msg></xml>";
|
|
}
|
|
}
|
|
|
|
|
|
- @PostMapping("getOpenIdCode/{orderId}")
|
|
|
|
|
|
+ @PostMapping("getOpenIdCode/{userId}")
|
|
public String getOpenIdCode(@PathVariable Long userId, @RequestBody @Validated Map map) throws UnsupportedEncodingException {
|
|
public String getOpenIdCode(@PathVariable Long userId, @RequestBody @Validated Map map) throws UnsupportedEncodingException {
|
|
String openIdCode = wxPayServiceMy.getOpenIdCode(userId, map.get("ip").toString());
|
|
String openIdCode = wxPayServiceMy.getOpenIdCode(userId, map.get("ip").toString());
|
|
System.out.println("授权地址+“--------------------------------------------------------" + openIdCode + "ip-----------------" + map.get("ip").toString());
|
|
System.out.println("授权地址+“--------------------------------------------------------" + openIdCode + "ip-----------------" + map.get("ip").toString());
|
|
@@ -213,6 +213,8 @@ public class PayController extends HttpServlet {
|
|
String accessToken = wxPayServiceMy.getAccessToken(code);
|
|
String accessToken = wxPayServiceMy.getAccessToken(code);
|
|
String userInfo = wxPayServiceMy.getUserInfo(accessToken, openId);
|
|
String userInfo = wxPayServiceMy.getUserInfo(accessToken, openId);
|
|
UserInfoWx userInfoWx = JSON.parseObject(JSON.toJSONString(userInfo), UserInfoWx.class);
|
|
UserInfoWx userInfoWx = JSON.parseObject(JSON.toJSONString(userInfo), UserInfoWx.class);
|
|
|
|
+ System.out.println(userInfo);
|
|
|
|
+ System.out.println(userInfoWx);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|