@Before(value={WechatApiConfigInterceptor.class,WechatUserInterceptor.class})
public abstract class JbootWechatController
extends JbootController
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ATTR_USER_OBJECT |
static String |
SESSION_WECHAT_ACCESS_TOKEN |
static String |
SESSION_WECHAT_OPEN_ID |
static String |
SESSION_WECHAT_SCOPE |
static String |
SESSION_WECHAT_USER_JSON |
| 构造器和说明 |
|---|
JbootWechatController() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearWechatSession() |
abstract Object |
doGetUserByOpenId(String openid)
进行用户查找,找到返回该用户,找不到返回 null
返回的object(用户)通过 getCurrentUser 可以得到。
|
void |
doNotAllowVisitRedirect() |
private void |
doRedirect(String gotoUrl,
String wechatOpenId,
String accessToken) |
abstract Object |
doSaveOrUpdateUserByApiResult(com.jfinal.weixin.sdk.api.ApiResult apiResult)
根据 apiResult 数据来保存或更新用户信息
用户第一次访问的时候
apiResult内如如下:
{
"subscribe": 1,
"openid": "o6_bmjrPTlm6_2sgVt7hMZOPfL2M",
"nickname": "Band",
"sex": 1,
"language": "zh_CN",
"city": "广州",
"province": "广东",
"country": "中国",
"headimgurl": "http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4
eMsv84eavHiaiceqxibJxCfHe/0",
"subscribe_time": 1382694957,
"unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL"
"remark": "",
"groupid": 0,
"tagid_list":[128,2]
}
|
com.jfinal.weixin.sdk.api.ApiConfig |
getApiConfig() |
<T> T |
getCurrentUser() |
void |
initJsSdkConfig() |
boolean |
isAllowVisit() |
void |
wechatCallback() |
_clear_, createJwtToken, getAttrs, getBaseUrl, getBean, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBigInteger, getBigInteger, getBigInteger, getCurrentUrl, getEscapePara, getEscapePara, getFile, getFileOnly, getFilesOnly, getFilesOnly, getFirstFileOnly, getIPAddress, getJsonBody, getJsonBody, getJsonBody, getJsonBody, getJsonBody, getJwtAttr, getJwtAttrs, getJwtPara, getJwtPara, getJwtParas, getJwtParaToBigInteger, getJwtParaToBigInteger, getJwtParaToInt, getJwtParaToInt, getJwtParaToLong, getJwtParaToLong, getJwtParaToString, getJwtParaToString, getOrginalRequest, getOriginalPara, getOriginalPara, getPara, getPara, getPara, getPara, getParas, getParaToBigDecimal, getParaToBigDecimal, getParaToBigDecimal, getParaToBigInteger, getParaToBigInteger, getParaToBigInteger, getParaToBigInteger, getParaToBigInteger, getRawObject, getRawObject, getRawObject, getRawObject, getRawObject, getReferer, getTrimPara, getTrimPara, getUnescapePara, getUnescapePara, getUserAgent, isAjaxRequest, isIEBrowser, isMobileBrowser, isMultipartRequest, isWechatBrowser, renderToStringWithAttrs, renderToStringWithAttrs, setJwtAttr, setJwtEmpty, setJwtMapcheckUrlPara, checkUrlPara, createToken, createToken, createToken, doSetCookie, forwardAction, get, get, get, get, getAttr, getAttr, getAttrForInt, getAttrForStr, getAttrNames, getBean, getBean, getBean, getBoolean, getBoolean, getBoolean, getBoolean, getBoolean, getControllerKey, getControllerPath, getCookie, getCookie, getCookieObject, getCookieObjects, getCookieToInt, getCookieToInt, getCookieToLong, getCookieToLong, getDate, getDate, getFile, getFile, getFile, getFile, getFiles, getFiles, getFiles, getFiles, getHeader, getInt, getInt, getInt, getInt, getInt, getKv, getLong, getLong, getLong, getLong, getLong, getModel, getModel, getModel, getModel, getPara, getParaMap, getParaNames, getParaToBoolean, getParaToBoolean, getParaToBoolean, getParaToBoolean, getParaToBoolean, getParaToDate, getParaToDate, getParaToDate, getParaToInt, getParaToInt, getParaToInt, getParaToInt, getParaToInt, getParaToLong, getParaToLong, getParaToLong, getParaToLong, getParaToLong, getParaValues, getParaValuesToInt, getParaValuesToLong, getProgressFile, getProgressFile, getProgressFile, getRawData, getRender, getRequest, getResponse, getSession, getSession, getSessionAttr, getSessionAttr, getViewPath, isJsonRequest, isParaBlank, isParaBlank, isParaExists, isParaExists, keepBean, keepBean, keepModel, keepModel, keepPara, keepPara, keepPara, keepPara, redirect, redirect, redirect301, redirect301, removeAttr, removeCookie, removeCookie, removeCookie, removeSessionAttr, render, render, render, renderCaptcha, renderError, renderError, renderError, renderFile, renderFile, renderFile, renderFile, renderFreeMarker, renderHtml, renderJavascript, renderJson, renderJson, renderJson, renderJson, renderJson, renderJsp, renderNull, renderQrCode, renderQrCode, renderTemplate, renderText, renderText, renderText, renderToString, renderXml, set, setAttr, setAttrs, setCookie, setCookie, setCookie, setCookie, setCookie, setCookie, setHttpServletRequest, setHttpServletResponse, setSessionAttr, setUrlPara, validateCaptcha, validateToken, validateTokenpublic static final String SESSION_WECHAT_OPEN_ID
public static final String SESSION_WECHAT_ACCESS_TOKEN
public static final String SESSION_WECHAT_SCOPE
public static final String SESSION_WECHAT_USER_JSON
public static final String ATTR_USER_OBJECT
public JbootWechatController()
public com.jfinal.weixin.sdk.api.ApiConfig getApiConfig()
@Clear(value=WechatUserInterceptor.class) public void wechatCallback()
private void doRedirect(String gotoUrl, String wechatOpenId, String accessToken)
public void clearWechatSession()
public void initJsSdkConfig()
public boolean isAllowVisit()
public void doNotAllowVisitRedirect()
public <T> T getCurrentUser()
public abstract Object doGetUserByOpenId(String openid)
openid - public abstract Object doSaveOrUpdateUserByApiResult(com.jfinal.weixin.sdk.api.ApiResult apiResult)
用户第一次访问的时候
apiResult内如如下: { "subscribe": 1, "openid": "o6_bmjrPTlm6_2sgVt7hMZOPfL2M", "nickname": "Band", "sex": 1, "language": "zh_CN", "city": "广州", "province": "广东", "country": "中国", "headimgurl": "http://wx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4 eMsv84eavHiaiceqxibJxCfHe/0", "subscribe_time": 1382694957, "unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL" "remark": "", "groupid": 0, "tagid_list":[128,2] }
apiResult - Copyright © 2024. All rights reserved.