Skip to main content

用户接口

微信小程序授权登录

接口地址

请求方式:POST 不需要授权
{host}/api/auth/wechat

退出登录

接口地址

请求方式:POST 需要授权
{host}/api/auth/logout

登录用户信息

接口地址

请求方式:GET 需要授权
{host}/api/user

更新用户信息

接口地址

请求方式:PUT 需要授权
{host}/api/user

更新用户头像

接口地址

请求方式:POST 需要授权
{host}/api/user_avatar

用户收货地址

接口地址

请求方式:GET 需要授权
{host}/api/user/addresses

响应结果

{
"code": "200",
"msg": "ok",
"data": {
"has_more": false,
"list": [{
"id": 2,
"name": "ceshi",
"phone": "13888888888",
"province_text": "北京市",
"city_text": "北京市",
"region_text": "东城区",
"label": "公司",
"address": "108号院",
"full_address": "北京市北京市东城区108号院"
}]
},
"trace": null
}

新增/修改收货地址

接口地址

请求方式:POST 需要授权
{host}/api/user/addresses

删除收货地址

接口地址

请求方式:DELETE 需要授权
{host}/api/user/addresses/{id}

用户默认收货地址

接口地址

请求方式:GET 需要授权
{host}/api/user/address/default

响应结果

{
"code": "200",
"msg": "ok",
"data": {
"name": "ceshi",
"phone": "13888888888",
"province_text": "北京市",
"city_text": "北京市",
"region_text": "东城区",
"label": "公司",
"address": "108号院",
"full_address": "北京市北京市东城区108号院"
}
}