5.12 更新当前用户资料【未授权拦截通过,待登录态联调】

PATCH /tieup/api/v1/me/profile

请求体:

{
  "nickname": "用户昵称",
  "avatar": "https://example.com/avatar.png",
  "gender": 1,
  "age": 25,
  "province_code": "310000",
  "province_name": "上海市",
  "city_code": "310100",
  "city_name": "上海市",
  "district_code": "310101",
  "district_name": "黄浦区",
  "signature": "个人签名"
}

请求参数:

参数 类型 必填 说明
nickname string 用户展示昵称
avatar string 头像图片 URL
gender integer 0=未知,1=男,2=女
age integer 用户年龄
province_code string/null 省级行政区编码
province_name string/null 省级行政区名称
city_code string/null 市级行政区编码
city_name string/null 市级行政区名称
district_code string/null 区县行政区编码
district_name string/null 区县行政区名称
signature string 个人签名或简介

鉴权:需要 Authorization: Bearer <access_token>

响应字段:

字段 类型 说明
id integer 主键 ID
rong_user_id string 当前使用端对应的融云用户 ID
group_code string 应用分组编码
channel_code string 渠道编码
nickname string 用户昵称
phone string 手机号
avatar string 头像 URL
profile_completion_step integer 当前资料完善步骤:0=未上传头像,1=已上传头像但核心资料未完善,2=核心资料已完善
gender integer 性别:0=未知,1=男,2=女
age integer/null 年龄
province_code / province_name string/null 省份编码和名称
city_code / city_name string/null 城市编码和名称
district_code / district_name string/null 区县编码和名称
signature string/null 个性签名
status integer 账号状态:1=正常,2=禁用,3=最终注销,4=注销中
is_idol integer 是否开通艺人身份:1=是,2=否
candy_balance string 糖果余额
online_status integer 在线状态:0=离线,1=在线
current_identity string 当前使用端:fan=粉丝端,artist=艺人端
available_identities array 当前账号可切换的使用端列表

响应示例:

{
  "code": 200,
  "message": "成功",
    "data": {
      "id": 10001,
      "rong_user_id": "tieup_fan_10001",
      "group_code": "tieup",
      "channel_code": "appstore",
      "phone": "13800138000",
      "nickname": "Tieup用户",
      "avatar": "https://cdn.example.com/avatar.png",
      "profile_completion_step": 2,
      "gender": 2,
      "age": 24,
      "province_code": "310000",
      "province_name": "上海市",
      "city_code": "310100",
      "city_name": "上海市",
      "district_code": "310101",
      "district_name": "黄浦区",
      "signature": "个人签名",
      "status": 1,
      "is_idol": 2,
      "candy_balance": "1000.00",
      "online_status": 1,
      "current_identity": "fan",
      "available_identities": [
        "fan"
      ]
  }
}

说明:当前仅允许更新头像、昵称、性别、年龄、地区和个性签名等资料字段,不允许通过该接口修改手机号、状态、身份、余额或资料完善步骤。响应中的 profile_completion_step 由更新后的当前资料实时计算,客户端无需也不能提交该字段。

测试状态:已完成代码实现和 PHP 语法检查,待资料编辑联调。