|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcom.github.sd4324530.fastweixin.api.BaseAPI
com.github.sd4324530.fastweixin.api.OauthAPI
public class OauthAPI
网页授权API
| 字段摘要 |
|---|
| 从类 com.github.sd4324530.fastweixin.api.BaseAPI 继承的字段 |
|---|
BASE_API_URL, config |
| 构造方法摘要 | |
|---|---|
OauthAPI(ApiConfig config)
|
|
| 方法摘要 | |
|---|---|
String |
getOauthPageUrl(String redirectUrl,
OauthScope scope,
String state)
生成回调url,这个结果要求用户在微信中打开,即可获得token,并指向redirectUrl |
OauthGetTokenResponse |
getToken(String code)
用户同意授权后在回调url中会得到code,调用此方法用code换token以及openid,所以如果仅仅是授权openid,到这步就结束了 |
GetUserInfoResponse |
getUserInfo(String token,
String openid)
获取用户详细信息 |
OauthGetTokenResponse |
refreshToken(String refreshToken)
刷新token |
boolean |
validToken(String token,
String openid)
校验token是否合法有效 |
| 从类 com.github.sd4324530.fastweixin.api.BaseAPI 继承的方法 |
|---|
executeGet, executePost, executePost, isSuccess |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public OauthAPI(ApiConfig config)
| 方法详细信息 |
|---|
public String getOauthPageUrl(String redirectUrl,
OauthScope scope,
String state)
redirectUrl - 用户自己设置的回调地址scope - 授权作用域state - 用户自带参数
public OauthGetTokenResponse getToken(String code)
code - 授权后得到的code
public OauthGetTokenResponse refreshToken(String refreshToken)
refreshToken - token对象中会包含refreshToken字段,通过这个字段再次刷新token
public GetUserInfoResponse getUserInfo(String token,
String openid)
token - tokenopenid - 用户openid
public boolean validToken(String token,
String openid)
token - tokenopenid - 用户openid
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||