package com.platform.util.corp; import com.alibaba.fastjson.JSON; import com.hx.mp.util.CorpMpUtil; import com.platform.util.HttpPlatformUtil; import com.platform.util.corp.entity.PersonnelQr; import net.sf.json.JSONObject; import org.apache.commons.collections.map.HashedMap; import java.text.MessageFormat; import java.util.Map; /**微信企业人员类 * @author CJH * @date 2021-10-21 */ public class PersonnelTool { /**用户详情信息*/ public static final String USER_INFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo"; /**企业微信,扫码登录 * @param accessToken 企业token * @param code 扫码code * @return */ public static PersonnelQr qrLoginInfo(String accessToken, String code){ Map keyValues = new HashedMap(); keyValues.put("access_token",accessToken); keyValues.put("code",code); String data = HttpPlatformUtil.HttpURLUtilJson(USER_INFO,null,keyValues,null,"POST"); return JSON.parseObject(data,PersonnelQr.class); } }