提交 | 用户 | age
|
6c1bfc
|
1 |
package com.platform.util.corp; |
C |
2 |
|
|
3 |
import com.alibaba.fastjson.JSON; |
|
4 |
import com.hx.mp.util.CorpMpUtil; |
|
5 |
import com.platform.util.HttpPlatformUtil; |
|
6 |
import com.platform.util.corp.entity.PersonnelQr; |
|
7 |
import net.sf.json.JSONObject; |
|
8 |
import org.apache.commons.collections.map.HashedMap; |
|
9 |
|
|
10 |
import java.text.MessageFormat; |
|
11 |
import java.util.Map; |
|
12 |
|
|
13 |
/**微信企业人员类 |
|
14 |
* @author CJH |
|
15 |
* @date 2021-10-21 |
|
16 |
*/ |
|
17 |
public class PersonnelTool { |
|
18 |
|
|
19 |
/**用户详情信息*/ |
|
20 |
public static final String USER_INFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo"; |
|
21 |
|
|
22 |
/**企业微信,扫码登录 |
|
23 |
* @param accessToken 企业token |
|
24 |
* @param code 扫码code |
|
25 |
* @return |
|
26 |
*/ |
|
27 |
public static PersonnelQr qrLoginInfo(String accessToken, String code){ |
|
28 |
|
|
29 |
Map<String,Object> keyValues = new HashedMap(); |
|
30 |
keyValues.put("access_token",accessToken); |
|
31 |
keyValues.put("code",code); |
|
32 |
String data = HttpPlatformUtil.HttpURLUtilJson(USER_INFO,null,keyValues,null,"POST"); |
|
33 |
|
|
34 |
return JSON.parseObject(data,PersonnelQr.class); |
|
35 |
|
|
36 |
} |
|
37 |
|
|
38 |
} |