添加appsecret
This commit is contained in:
parent
2704de678c
commit
e96fc8cce0
|
@ -274,7 +274,6 @@ public class WechatPayController {
|
||||||
|
|
||||||
@PostMapping("/getUserInfo")
|
@PostMapping("/getUserInfo")
|
||||||
public JSONObject getWxUserInfo(@RequestBody Map<String,String> params) throws Exception {
|
public JSONObject getWxUserInfo(@RequestBody Map<String,String> params) throws Exception {
|
||||||
// String accessToken = getToken(GET_TOKEN_URL, "wx8fc3e4305d2fbf0b", "3bf3dd4ec72f591432db6b28c2c044e5");// 获取token
|
|
||||||
String accessToken = params.get("access_token");
|
String accessToken = params.get("access_token");
|
||||||
String openid = params.get("openid");
|
String openid = params.get("openid");
|
||||||
System.out.println("---------token-------"+accessToken);
|
System.out.println("---------token-------"+accessToken);
|
||||||
|
@ -300,9 +299,9 @@ public class WechatPayController {
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/getJsApiInfo")
|
@PostMapping("/getJsApiInfo")
|
||||||
public static 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, "wx8fc3e4305d2fbf0b", "3bf3dd4ec72f591432db6b28c2c044e5");// 获取token
|
String accessToken = getToken(GET_TOKEN_URL, wechatpayConfig.getAppid(), wechatpayConfig.getAppsecret());// 获取token
|
||||||
String accessToken = params.get("access_token");
|
// String accessToken = params.get("access_token");
|
||||||
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";
|
||||||
|
|
|
@ -33,6 +33,10 @@ public class WechatpayConfig {
|
||||||
@Value("${wxpay.notify-domain}")
|
@Value("${wxpay.notify-domain}")
|
||||||
private String notifyDomain;
|
private String notifyDomain;
|
||||||
|
|
||||||
|
// APPID
|
||||||
|
@Value("${wxpay.appsecret}")
|
||||||
|
private String appsecret;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,6 +395,8 @@ wxpay:
|
||||||
api-v3-key: asdfiuzwe3534565478WETDSAFRWEq1E
|
api-v3-key: asdfiuzwe3534565478WETDSAFRWEq1E
|
||||||
# APPID
|
# APPID
|
||||||
appid: wx8fc3e4305d2fbf0b
|
appid: wx8fc3e4305d2fbf0b
|
||||||
|
# appsecret
|
||||||
|
appsecret: 3bf3dd4ec72f591432db6b28c2c044e5
|
||||||
# 商户ID
|
# 商户ID
|
||||||
mch-id: 1717618860
|
mch-id: 1717618860
|
||||||
# 商户API证书序列号
|
# 商户API证书序列号
|
||||||
|
|
|
@ -391,6 +391,8 @@ wxpay:
|
||||||
api-v3-key: asdfiuzwe3534565478WETDSAFRWEq1E
|
api-v3-key: asdfiuzwe3534565478WETDSAFRWEq1E
|
||||||
# APPID
|
# APPID
|
||||||
appid: wx8fc3e4305d2fbf0b
|
appid: wx8fc3e4305d2fbf0b
|
||||||
|
# appsecret
|
||||||
|
appsecret: 3bf3dd4ec72f591432db6b28c2c044e5
|
||||||
# 商户ID
|
# 商户ID
|
||||||
mch-id: 1717618860
|
mch-id: 1717618860
|
||||||
# 商户API证书序列号
|
# 商户API证书序列号
|
||||||
|
|
|
@ -389,6 +389,8 @@ wxpay:
|
||||||
api-v3-key: asdfiuzwe3534565478WETDSAFRWEq1E
|
api-v3-key: asdfiuzwe3534565478WETDSAFRWEq1E
|
||||||
# APPID
|
# APPID
|
||||||
appid: wx8fc3e4305d2fbf0b
|
appid: wx8fc3e4305d2fbf0b
|
||||||
|
# appsecret
|
||||||
|
appsecret: 3bf3dd4ec72f591432db6b28c2c044e5
|
||||||
# 商户ID
|
# 商户ID
|
||||||
mch-id: 1717618860
|
mch-id: 1717618860
|
||||||
# 商户API证书序列号
|
# 商户API证书序列号
|
||||||
|
|
Loading…
Reference in New Issue