diff --git a/ruoyi-admin/src/main/java/org/dromara/web/common/WxXcxUtils.java b/ruoyi-admin/src/main/java/org/dromara/web/common/WxXcxUtils.java deleted file mode 100644 index 60a638b..0000000 --- a/ruoyi-admin/src/main/java/org/dromara/web/common/WxXcxUtils.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.dromara.web.common; - - -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson.JSONObject; - -/** - * @author Maosw - */ -public class WxXcxUtils { - - static String appid = "wxf1d78a0b58fc890c"; - static String secret = "e1a3e888471d48addf1a23e4c9ea7f84"; - - public static String getAccessToken(){ - String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appid+"&secret="+secret; - String result = HttpUtil.get(url); - JSONObject jsonObject = JSONObject.parseObject(result); - return jsonObject.get("access_token").toString(); - } - - public static JSONObject getUserPhoneNumber(String code){ - String accessToken = getAccessToken(); - String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token="+accessToken; - - JSONObject json = new JSONObject(); - json.put("code", code); - String result = HttpRequest.post(url).body(json.toString()).execute().body(); - - JSONObject jsonObject = JSONObject.parseObject(result); - return jsonObject; - } - -}