一.说明
- 格式:
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": ""
}