Browse Source

Merge pull request #21 from gaigeshen/develop

增加生成授权链接方法,重定向链接可直接读取配置。
master
MillerLin 8 years ago
committed by GitHub
parent
commit
c2f00a1ac0
2 changed files with 18 additions and 0 deletions
  1. +10
    -0
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java
  2. +8
    -0
      weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java

+ 10
- 0
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpService.java View File

@@ -392,6 +392,16 @@ public interface WxCpService {
*/
void tagAddUsers(String tagId, List<String> userIds, List<String> partyIds) throws WxErrorException;

/**
* <pre>
* 构造oauth2授权的url连接
* </pre>
*
* @param state
* @return
*/
String oauth2buildAuthorizationUrl(String state);
/**
* <pre>
* 构造oauth2授权的url连接


+ 8
- 0
weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpServiceImpl.java View File

@@ -444,6 +444,14 @@ public class WxCpServiceImpl implements WxCpService {
}

@Override
public String oauth2buildAuthorizationUrl(String state) {
return this.oauth2buildAuthorizationUrl(
this.wxCpConfigStorage.getOauth2redirectUri(),
state
);
}

@Override
public String oauth2buildAuthorizationUrl(String redirectUri, String state) {
String url = "https://open.weixin.qq.com/connect/oauth2/authorize?";
url += "appid=" + wxCpConfigStorage.getCorpId();


Loading…
Cancel
Save