public interface WxMaUserService
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkUserInfo(String sessionKey,
String rawData,
String signature)
验证用户信息完整性.
|
WxMaCode2VerifyInfoResult |
getCode2VerifyInfo(String code,
String checkcode)
多端登录验证接口.
|
WxMaPhoneNumberInfo |
getPhoneNoInfo(String code)
已过时。
|
WxMaPhoneNumberInfo |
getPhoneNoInfo(String sessionKey,
String encryptedData,
String ivStr)
已过时。
当前(基础库2.21.2以下使用)旧版本,以上请使用替代方法
getPhoneNoInfo(String) |
WxMaPhoneNumberInfo |
getPhoneNumber(String code)
获取手机号信息,基础库:2.21.2及以上或2023年8月28日起
|
WxMaJscode2SessionResult |
getSessionInfo(String jsCode)
获取登录后的session信息.
|
WxMaUserInfo |
getUserInfo(String sessionKey,
String encryptedData,
String ivStr)
解密用户敏感数据.
|
void |
setUserStorage(Map<String,String> kvMap,
String sessionKey,
String openid)
上报用户数据后台接口.
|
WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException
jsCode - 登录时获取的 codeWxErrorException - .WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String ivStr)
sessionKey - 会话密钥encryptedData - 消息密文ivStr - 加密算法的初始向量void setUserStorage(Map<String,String> kvMap, String sessionKey, String openid) throws WxErrorException
小游戏可以通过本接口上报key-value数据到用户的CloudStorage。
文档参考https://developers.weixin.qq.com/minigame/dev/document/open-api/data/setUserStorage.htmlkvMap - 要上报的数据sessionKey - 通过wx.login 获得的登录态openid - .WxErrorException - .@Deprecated WxMaPhoneNumberInfo getPhoneNoInfo(String sessionKey, String encryptedData, String ivStr)
getPhoneNoInfo(String)sessionKey - 会话密钥encryptedData - 消息密文ivStr - 加密算法的初始向量WxMaPhoneNumberInfo getPhoneNumber(String code) throws WxErrorException
code - 每个code只能使用一次,code的有效期为5min。code获取方式参考手机号快速验证组件WxErrorException - .@Deprecated WxMaPhoneNumberInfo getPhoneNoInfo(String code) throws WxErrorException
code - 每个code只能使用一次,code的有效期为5min。code获取方式参考手机号快速验证组件WxErrorException - .boolean checkUserInfo(String sessionKey, String rawData, String signature)
sessionKey - 会话密钥rawData - 微信用户基本信息signature - 数据签名WxMaCode2VerifyInfoResult getCode2VerifyInfo(String code, String checkcode) throws WxErrorException
通过 code 换取用户登录态信息,用于多端登录场景(如手表端)。
文档地址:多端登录code - 登录时获取的 codecheckcode - 手表授权页面返回的 checkcodeWxErrorException - 调用微信接口失败时抛出Copyright © 2026. All rights reserved.