Skip to content

Commit 40430a7

Browse files
committed
二次验证支持
1 parent 471b4a7 commit 40430a7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

weixin-java-enterprise/src/main/java/me/chanjar/weixin/enterprise/api/WxCpService.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,16 @@ public interface WxCpService {
2828
* @return
2929
*/
3030
public boolean checkSignature(String msgSignature, String timestamp, String nonce, String data);
31-
31+
32+
/**
33+
* <pre>
34+
* 用在二次验证的时候
35+
* 企业在员工验证成功后,调用本方法告诉企业号平台该员工关注成功。
36+
* </pre>
37+
* @param userId
38+
*/
39+
public void userAuthenticated(String userId) throws WxErrorException;
40+
3241
/**
3342
* <pre>
3443
* 获取access_token,本方法线程安全

weixin-java-enterprise/src/main/java/me/chanjar/weixin/enterprise/api/WxCpServiceImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public boolean checkSignature(String msgSignature, String timestamp, String nonc
6060
}
6161
}
6262

63+
public void userAuthenticated(String userId) throws WxErrorException {
64+
String url = "https://qyapi.weixin.qq.com/cgi-bin/user/authsucc?userid=" + userId;
65+
execute(new SimpleGetRequestExecutor(), url, null);
66+
}
6367

6468
public void accessTokenRefresh() throws WxErrorException {
6569
if (!GLOBAL_ACCESS_TOKEN_REFRESH_FLAG.getAndSet(true)) {

0 commit comments

Comments
 (0)