在系统登录态生效期间,调用接口检查当前用户账号绑定信息。
前置准备
调用 wx.xxxLogin 登录成功。
参数
Object object
| 属性 |
类型 |
默认值 |
必填 |
说明 |
| success |
function |
|
否 |
接口调用成功的回调函数 |
| fail |
function |
|
否 |
接口调用失败的回调函数 |
| complete |
function |
|
否 |
接口调用结束的回调函数 |
object.success 回调函数
参数
Object res
| 属性 |
类型 |
说明 |
| hasBoundPhone |
bool |
当前用户是否已经绑定手机号。 |
| hasBoundWeixin |
bool |
当前用户是否已经绑定微信。 |
| hasBoundApple |
bool |
当前用户是否已经绑定苹果账号。 |
object.fail 回调函数
参数
Object res
| 属性 |
类型 |
说明 |
| errCode |
number |
错误码 |
| errMsg |
string |
错误提示 |
res.errCode
| errCode |
说明 |
| -1 |
system error |
示例代码
wx.miniapp.checkBindInfo({
success(res) {
if(res.hasBoundPhone) {
} else {
}
if(res.hasBoundWeixin) {
} else {
}
if(res.hasBoundApple) {
} else {
}
}
})