public class WeixinComponentProxy extends Object
Description:
| 构造器和说明 |
|---|
WeixinComponentProxy(WeixinMPlatformAccount weixinMPlatformAccount) |
WeixinComponentProxy(WeixinMPlatformAccount weixinMPlatformAccount,
AbstractCacheStorager<Token> cacheStorager,
String componentAuthRedirectUrl,
String userAuthRedirectUrl,
String openUserAuthRedirectUrl) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cacheComponentTicket(String componentId,
String componentTicket)
缓存组件ticket
|
ComponentProxy |
component()
获取组接口对象(只关注第一个组件
|
ComponentProxy |
component(String componentId)
获取套件接口对象(多个组件
|
String |
getComponentAuthorizationURL(String componentId)
应用组件授权 需先缓存ticket
redirectUri默认填写weixin4j.properties#component.oauth.redirect.uri
state默认填写state
|
String |
getComponentAuthorizationURL(String componentId,
String redirectUri,
String state)
应用组件授权 需先缓存ticket,在授权完成之后需要调用ComponentApi#
exchangeAuthorizerToken方法 ,否则无法缓存token相关导致后续的组件接口调用失败
|
String |
getPreComponentTicket(String componentId)
获取组件的预授权码 需先缓存ticket
|
WeixinMPlatformAccount |
getWeixinMpAccount()
获取微信账号信息
|
WeixinMPlatformProxy |
getWeixinProxy(String componentId,
String authAppId)
创建WeixinProxy对象
|
public WeixinComponentProxy(WeixinMPlatformAccount weixinMPlatformAccount)
public WeixinComponentProxy(WeixinMPlatformAccount weixinMPlatformAccount, AbstractCacheStorager<Token> cacheStorager, String componentAuthRedirectUrl, String userAuthRedirectUrl, String openUserAuthRedirectUrl)
public WeixinMPlatformAccount getWeixinMpAccount()
public ComponentProxy component()
ComponentProxypublic ComponentProxy component(String componentId)
componentId - 组件IDComponentProxypublic String getPreComponentTicket(String componentId) throws WeixinException
componentId - 组件IDWeixinExceptioncacheComponentTicket(String, String),
ComponentProxy,
ComponentProxy.getTicketManager(),
ComponentProxy.getPreCodeManager()public void cacheComponentTicket(String componentId, String componentTicket) throws WeixinException
componentId - 组件IDcomponentTicket - 组件ticket内容WeixinExceptionpublic String getComponentAuthorizationURL(String componentId) throws WeixinException
componentId - 组件IDWeixinExceptionpublic String getComponentAuthorizationURL(String componentId, String redirectUri, String state) throws WeixinException
componentId - 组件IDredirectUri - 授权后重定向urlstate - 回调后原样返回WeixinExceptioncacheComponentTicket(String, String),
ComponentProxy,
ComponentProxy.getTicketManager(),
ComponentProxy.getPreCodeManager(),
ComponentProxy.exchangeAuthorizerToken(String),
应用组件授权public WeixinMPlatformProxy getWeixinProxy(String componentId, String authAppId)
componentId - 组件IDauthAppId - 已授权的appidWeixinMPlatformProxyCopyright © 2020. All rights reserved.