public class WxMaUserServiceImpl extends Object implements WxMaUserService
| 构造器和说明 |
|---|
WxMaUserServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkUserInfo(String sessionKey,
String rawData,
String signature)
验证用户信息完整性.
|
WxMaPhoneNumberInfo |
getPhoneNoInfo(String code)
获取手机号信息,基础库:2.21.2及以上或2023年8月28日起
|
WxMaPhoneNumberInfo |
getPhoneNoInfo(String sessionKey,
String encryptedData,
String ivStr)
解密用户手机号信息.
|
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)
上报用户数据后台接口.
|
public WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException
WxMaUserServicegetSessionInfo 在接口中 WxMaUserServicejsCode - 登录时获取的 codeWxErrorException - .public WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String ivStr)
WxMaUserServicegetUserInfo 在接口中 WxMaUserServicesessionKey - 会话密钥encryptedData - 消息密文ivStr - 加密算法的初始向量public void setUserStorage(Map<String,String> kvMap, String sessionKey, String openid) throws WxErrorException
WxMaUserService小游戏可以通过本接口上报key-value数据到用户的CloudStorage。
文档参考https://developers.weixin.qq.com/minigame/dev/document/open-api/data/setUserStorage.htmlsetUserStorage 在接口中 WxMaUserServicekvMap - 要上报的数据sessionKey - 通过wx.login 获得的登录态openid - .WxErrorException - .public WxMaPhoneNumberInfo getPhoneNoInfo(String sessionKey, String encryptedData, String ivStr)
WxMaUserServicegetPhoneNoInfo 在接口中 WxMaUserServicesessionKey - 会话密钥encryptedData - 消息密文ivStr - 加密算法的初始向量public WxMaPhoneNumberInfo getPhoneNumber(String code) throws WxErrorException
WxMaUserServicegetPhoneNumber 在接口中 WxMaUserServicecode - 每个code只能使用一次,code的有效期为5min。code获取方式参考手机号快速验证组件WxErrorException - .public WxMaPhoneNumberInfo getPhoneNoInfo(String code) throws WxErrorException
WxMaUserServicegetPhoneNoInfo 在接口中 WxMaUserServicecode - 每个code只能使用一次,code的有效期为5min。code获取方式参考手机号快速验证组件WxErrorException - .public boolean checkUserInfo(String sessionKey, String rawData, String signature)
WxMaUserServicecheckUserInfo 在接口中 WxMaUserServicesessionKey - 会话密钥rawData - 微信用户基本信息signature - 数据签名Copyright © 2025. All rights reserved.