Table of Contents
5.10 切换当前使用端【未授权拦截通过,待登录态联调】
POST /tieup/api/v1/me/current-identity
请求体:
{
"identity": "artist"
}
请求参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
identity |
string | 是 | fan=粉丝端,artist=艺人端 |
响应字段:
| 字段 | 类型 | 说明 |
|---|---|---|
access_token |
string | APP Access Token |
refresh_token |
string | APP Refresh Token |
expires_in |
integer | Access Token 有效时长,单位秒 |
user |
object | 当前用户完整资料对象,字段定义与注册接口一致 |
user.profile_completion_step |
integer | 当前资料完善步骤:0=未上传头像,1=已上传头像但核心资料未完善,2=核心资料已完善 |
user.current_identity |
string | 切换后的当前使用端:fan=粉丝端,artist=艺人端 |
响应示例:
{
"code": 200,
"message": "成功",
"data": {
"access_token": "app_access_token",
"refresh_token": "app_refresh_token",
"expires_in": 7200,
"user": {
"id": 10001,
"rong_user_id": "tieup_artist_20001",
"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": null,
"province_name": null,
"city_code": null,
"city_name": null,
"district_code": null,
"district_name": null,
"signature": "保持热爱",
"status": 1,
"is_idol": 1,
"candy_balance": "1000.00",
"online_status": 1,
"current_identity": "artist",
"available_identities": [
"fan",
"artist"
]
}
}
}
业务规则:切换到 artist 时实时校验 tieup_user.is_idol = 1 且存在 tieup_artist 档案,切换成功后重新签发 Token。
鉴权:需要 Authorization: Bearer <access_token>。
测试状态:已完成代码实现和 PHP 语法检查,待粉丝/偶像身份切换联调。