修改测试环境登录问题

This commit is contained in:
sh
2025-11-27 17:55:12 +08:00
parent b21c4dbcb8
commit d91c4cfb1c

View File

@@ -249,7 +249,7 @@ public class WechatUtil {
try { try {
System.out.println("appid==============="+appid); System.out.println("appid==============="+appid);
System.out.println("secret================"+secret); System.out.println("secret================"+secret);
String response = getAccessData("http://192.168.2.102:10044/weixin?appid="+appid+"&secret="+secret+"&js_code="+code+"&grant_type=authorization_code"); String response = getAccessData("https://api.weixin.qq.com/sns/jscode2session?appid="+appid+"&secret="+secret+"&js_code="+code+"&grant_type=authorization_code");
JSONObject result = JSONObject.parseObject(response); JSONObject result = JSONObject.parseObject(response);
// 微信返回错误码处理 // 微信返回错误码处理
if (result.containsKey("errcode") && result.getInteger("errcode") != 0) { if (result.containsKey("errcode") && result.getInteger("errcode") != 0) {