修改认证接口,添加参数
This commit is contained in:
parent
e96fc8cce0
commit
6961070fe8
|
@ -301,7 +301,8 @@ public class WechatPayController {
|
||||||
@PostMapping("/getJsApiInfo")
|
@PostMapping("/getJsApiInfo")
|
||||||
public Map<String,String> getJsApiInfo(@RequestBody Map<String,String> params) throws Exception {
|
public Map<String,String> getJsApiInfo(@RequestBody Map<String,String> params) throws Exception {
|
||||||
String accessToken = getToken(GET_TOKEN_URL, wechatpayConfig.getAppid(), wechatpayConfig.getAppsecret());// 获取token
|
String accessToken = getToken(GET_TOKEN_URL, wechatpayConfig.getAppid(), wechatpayConfig.getAppsecret());// 获取token
|
||||||
// String accessToken = params.get("access_token");
|
String firstUrl = params.get("url");
|
||||||
|
System.out.println("---------firstUrl-------"+firstUrl);
|
||||||
System.out.println("---------token-------"+accessToken);
|
System.out.println("---------token-------"+accessToken);
|
||||||
// 构造请求URL
|
// 构造请求URL
|
||||||
String requestUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi";
|
String requestUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi";
|
||||||
|
@ -327,6 +328,8 @@ public class WechatPayController {
|
||||||
.append(nonceStr)
|
.append(nonceStr)
|
||||||
.append("×tamp=")
|
.append("×tamp=")
|
||||||
.append(timestamp)
|
.append(timestamp)
|
||||||
|
.append("&url=")
|
||||||
|
.append(firstUrl)
|
||||||
.toString();// 得到签名
|
.toString();// 得到签名
|
||||||
String signature = encryptSHA(string1);
|
String signature = encryptSHA(string1);
|
||||||
|
|
||||||
|
@ -334,6 +337,7 @@ public class WechatPayController {
|
||||||
map.put("signature", signature);
|
map.put("signature", signature);
|
||||||
map.put("timestamp", timestamp);
|
map.put("timestamp", timestamp);
|
||||||
map.put("nonceStr", nonceStr);
|
map.put("nonceStr", nonceStr);
|
||||||
|
map.put("firstUrl", firstUrl);
|
||||||
|
|
||||||
System.out.println("---------jsonObject-------"+signature);
|
System.out.println("---------jsonObject-------"+signature);
|
||||||
return map;
|
return map;
|
||||||
|
|
Loading…
Reference in New Issue