增加生成授权链接方法,重定向链接可直接读取配置。

This commit is contained in:
gaigeshen
2016-08-12 10:20:11 +08:00
parent ccecac9e5e
commit 5057f2d846
2 changed files with 18 additions and 0 deletions

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连接

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();