文档地址:https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html
//头像
//昵称
.tl-card-right{
height: 140rpx;
display: flex;
justify-content: flex-start;
align-items: center;
.tl-position-r{
position: relative;
}
.tl-p-right{
position: absolute;
top: -6rpx;
right: -18rpx;
width: 34rpx;
height: 22rpx;
background: #F23034;
opacity: 1;
border-radius: 12rpx;
color: #fff;
font-size: 18rpx;
text-align: center;
}
}
.userinfo-avatar {
overflow:hidden;
display: block;
width: 104rpx;
height: 104rpx;
border-radius: 50%;
border: 2px solid #fff;
box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
}
我们推出一个接口,可以通过根据传手机号查询返回平台头像昵称性别地区API接口
host(htts接口域名):http://open.caiyunyi.com
————————————————
ID密钥请扫码获取
第一步 获取token:(token有效期2小时,到期后,请重新本接口刷新)
{{host}}/api/auth/token
POST调用方式
传入参数:
返回
token:3884*************************aec4e7
————————————————————————————————
第二步 传入手机号查询api
{{host}}/api/wx_user/get_wx_userinfo
POST调用方式
传入参数:
返回
token:3884*************************aec4e7
返回
状态码:code
说明:msg
code1成功;0失败
————————————————————————————————
第三步 回调地址填写
请扫码后,授权登录获得id和密钥,之后在页面设置回调地址:
仅支持https协议,系统会在获得到数据后,通过回调的方式返回给你设置的地址上
系统会将手机号对应结果回调到你的接口地址
Get请求
https://你自己的域名/回调接口地址
示例:
https://回调接口地址?nickname=昵称?sex=1?headimgur=头像地址
sex合法值 0,1,2
0未知,1男 , 2女