说明:需要登陆
GET /index.php/online_chat/chat/getWebsocketAccessToken
参数:
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
chat_type | 是 | int | 聊天类型 |
返回示例
{
"code": 200,
"msg": "",
"data": {
"userinfo": {
"uid": 10056,
"user_type": 0,
"name": "花",
"head_img": "http://chat.mpfphp.com/static/img/head_img/16.jpg"
},
"wesocket_access_token": "f5419fb071e5f50f491ca2129de32629",
"ws_addr": "ws://chat.mpfphp.com:2080?access_token=f5419fb071e5f50f491ca2129de32629"
}
}
返回参数字段说明
参数名 | 类型 | 说明 |
---|---|---|
code | int | 状态码,200代表成功,其他失败 |
msg | int | 消息说明 |
data | object | 数据 |
data.userinfo | object | 用户信息 |
data.userinfo.uid | int | 用户id |
data.userinfo.user_type | int | 用户类型 |
data.userinfo.name | string | 昵称 |
data.userinfo.head_img | string | 头像 |
data.wesocket_access_token | string | websocket访问token |
data.ws_addr | string | websocket的地址 |