5.11 获取用户信息
优质
小牛编辑
134浏览
2023-12-01
QN.user.getInfo(options)
获取用户信息
响应
名称 | 类型 | 是否必须返回 | 含义 |
---|---|---|---|
result | Object | 响应对象 | |
result.errorCode | Number | 错误码,成功为0,失败为非0 | |
result.errorMsg | String | 错误信息 | |
result.user_id | String | 用户的数字id | |
result.user_nick | String | 用户用户名 | |
result.sub_user_id | String | 如果登录账号为子账号,返回子账号的数字id,否则为空 | |
result.sub_user_nick | String | 如果登录账号为子账号,返回子账号的用户名,否则为空 | |
result.avatar | String | 用户头像 |
示例
QN.user.getInfo({
success(result) {
console.log(result);
},
error(error) {
console.log(error);
}
}).then(result => {
console.log(result);
}, error => {
console.log(error);
});