feat:微信工具添加openid获取方法

master
tangfudong 2024-03-27 14:55:03 +08:00
parent 404b7acb72
commit 6c3cd91a36
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ public class WeChatUtil {
return "";
}
public static String getOp(String appId, String secret, String code) {
public static String getOpenId(String appId, String secret, String code) {
String url=authUrl+"?appid="+appId+"&secret="+secret+"&js_code="+code+"&grant_type=authorization_code";
String ret=WeChatUtil.httpRequest(url,"GET",null);
String openid = JsonUtils.parseMap(ret).getStr("openid");