u
This commit is contained in:
parent
954ee2175c
commit
2058decfa9
@ -56,7 +56,7 @@ weixin4j.properties说明
|
||||
|
||||
| 属性名 | 说明 |
|
||||
| :---------- | :-------------- |
|
||||
| account | 微信公众号信息 `json格式` |
|
||||
| account | 微信公众号信息 `json格式`(按需填写) |
|
||||
| token_path | 使用FileTokenStorager时token保存的物理路径 |
|
||||
| qr_path | 调用二维码接口时保存二维码图片的物理路径 |
|
||||
| media_path | 调用媒体接口时保存媒体文件的物理路径 |
|
||||
|
||||
@ -48,7 +48,7 @@ weixin4j.properties说明
|
||||
|
||||
| 属性名 | 说明 |
|
||||
| :---------- | :-------------- |
|
||||
| account | 微信企业号信息 `json格式` |
|
||||
| account | 微信企业号信息 `json格式`(按需填写) |
|
||||
| token_path | 使用FileTokenStorager时token保存的物理路径 |
|
||||
| media_path | 调用媒体接口时保存媒体文件的物理路径 |
|
||||
| user_oauth_redirect_uri | 企业号用户身份授权后重定向的url(OauthApi接口) |
|
||||
@ -58,7 +58,7 @@ weixin4j.properties说明
|
||||
示例(properties中换行用右斜杆\\)
|
||||
|
||||
account={"id":"corpid","secret":"corpsecret",\
|
||||
"token":"企业号中应用在回调模式下的token",\
|
||||
"suiteId":"应用套件的id","suiteSecret":"应用套件的secret",\
|
||||
"providerSecret:"第三方提供商secret(企业号登陆)",\
|
||||
"chatSecret":"消息服务secret(企业号聊天)"}
|
||||
|
||||
|
||||
@ -50,8 +50,6 @@ public class WeixinSuiteProxy {
|
||||
* 应用ID
|
||||
* @param suiteSecret
|
||||
* 应用secret
|
||||
* @param ticketStorager
|
||||
* 应用ticket存储器(用于读取)
|
||||
* @param tokenStorager
|
||||
* 应用token存储器
|
||||
* @throws WeixinException
|
||||
@ -115,7 +113,7 @@ public class WeixinSuiteProxy {
|
||||
* 授权方corpid
|
||||
* @return 企业号token
|
||||
*/
|
||||
public TokenHolder crateTokenHolder(String authCorpid) {
|
||||
public TokenHolder createTokenHolder(String authCorpid) {
|
||||
return suiteApi.createTokenHolder(authCorpid);
|
||||
}
|
||||
|
||||
|
||||
@ -19,6 +19,23 @@ public class WeixinQyAccount extends WeixinAccount {
|
||||
|
||||
private static final long serialVersionUID = 3689999353867189585L;
|
||||
|
||||
/**
|
||||
* 应用套件id
|
||||
*/
|
||||
private String suiteId;
|
||||
/**
|
||||
* 应用套件secret
|
||||
*/
|
||||
private String suiteSecret;
|
||||
/**
|
||||
* 第三方提供商secret(企业号登陆)
|
||||
*/
|
||||
private String providerSecret;
|
||||
/**
|
||||
* 消息服务secret(企业号聊天)
|
||||
*/
|
||||
private String chatSecret;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param corpid
|
||||
@ -48,23 +65,6 @@ public class WeixinQyAccount extends WeixinAccount {
|
||||
this.chatSecret = chatSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用套件id
|
||||
*/
|
||||
private String suiteId;
|
||||
/**
|
||||
* 应用套件secret
|
||||
*/
|
||||
private String suiteSecret;
|
||||
/**
|
||||
* 第三方提供商secret(企业号登陆)
|
||||
*/
|
||||
private String providerSecret;
|
||||
/**
|
||||
* 消息服务secret(企业号聊天)
|
||||
*/
|
||||
private String chatSecret;
|
||||
|
||||
public String getSuiteId() {
|
||||
return suiteId;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ public class SuiteTicketHolder {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找ticket
|
||||
* 获取ticket
|
||||
*
|
||||
* @return
|
||||
* @throws WeixinException
|
||||
@ -42,6 +42,10 @@ public class SuiteTicketHolder {
|
||||
* @return
|
||||
*/
|
||||
public String getCacheKey() {
|
||||
return getCacheKey0(suiteId);
|
||||
}
|
||||
|
||||
private String getCacheKey0(String suiteId) {
|
||||
return String.format("qy_suite_ticket_%s", suiteId);
|
||||
}
|
||||
|
||||
@ -55,7 +59,7 @@ public class SuiteTicketHolder {
|
||||
throws WeixinException {
|
||||
Token token = new Token(suiteTicket.getSuiteTicket());
|
||||
token.setExpiresIn(-1);
|
||||
tokenStorager.caching(getCacheKey(), token);
|
||||
tokenStorager.caching(getCacheKey0(suiteTicket.getSuiteId()), token);
|
||||
}
|
||||
|
||||
public String getSuiteId() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user