一.說明
- 格式:
http://hostname:port/api?protocol=protocolid
- 請求方式 默認POST
例 注冊:
http://127.0.0.1:10701?protocol=1000
- 協議號格式:
xxxyyz xxx:大類型(1-999); yy:小類型(0-99); z:版本號(0-9)
二. 協議號
用戶相關 大類型:001
-
注冊 protocol=1000
REQ:
{
"nick": "tom",
"mail": "tom@163.com",
"phone": "13800138000",
"pwd": "md5_pwd",
"head": "1",
"wechat": "",
"qq": ""
}
/*
"mail" 與"phone" //至少有一個不為空
"pwd" //必填字段,密碼md5(md5(pwd).substring(7))
*/
RES:
{
"retCode": "0",
"retMsg": ""
}
-
登錄 protocol=1010
REQ:
{
"type": 1,
"account": "tom@163.com",
"pwd": "md5_pwd",
"device": "deviceid"
}
/*
"type" //1.郵箱;2.手機號;3: 第三方登錄
"account" //type=1|2-->郵箱||手機號;type=3-->QQOpenID
"pwd" //type=1|2-->pwd=md5(account+md5(md5(pwd).substring(7));type=3-->WechatKey
"device" //可用UMengId,個推ID等
*/
RES
{
"retCode": "0",
"retMsg": "",
"uid": 100,
"token": "",
"type": 1,
"account": "tom@163.com"
}
/*
"type" //登錄時的賬號類型
*/
-
重登錄 protocol=1020
REQ:
{
"token":"token",
"device": "deviceid"
}
/*
"device" //為登錄時關聯的設備指紋
*/
RES
{
"retCode": "0",
"retMsg": "",
"uid": 100,
"token": ""
}
-
修改密碼 protocol=1030
REQ:
{
"token":"token",
"oldPwd":"md5_pwd",
"newPwd":"md5_pwd",
}
/**
"pwd" //必填字段,密碼md5(md5(pwd).substring(7))
注:郵箱和手機號登錄可修改密碼,第三方登錄不能修改密碼
**/
RES
{
"retCode": "0",
"retMsg": ""
}