-
Notifications
You must be signed in to change notification settings - Fork 11
index_auth
New Future edited this page Apr 3, 2016
·
2 revisions
验证接口 之后会调整登录策略
POST /auth/
{number:'学号',password:'密码'}
参数说明
-
number
学号 ,必须 -
password
密码,必须 -
sch_id
限制学校,可选 -
code
验证码,可选 -
verify_cookie
验证码同步cookie,可选(app端使用)
响应
注册(验证成功)
{
"status": 2,
"info":{
"sid":"字符串session id",
"user":{
"number":"学号",
"name":"姓名",
"sch_id":"学校id"
},
"msg":"验证成功",
"url":"/User/"
}
}
登录成功
{
"status": 1,
"info":{
"sid":"session id",
"user":{
"number":"学号",
"name":"姓名",
"sch_id":"学校id"
},
"msg":"登录成功",
"token":"用于保存token"
}
}
说明其中token
和sid
(header中的Session-ID
的参数)为APP中使用的参数
GET /auth/logout
响应
{
"status": 1,
"info":"注销成功!"
}
- 验证auth
- 资源books【部分需登录】
- 文件file【必须已登录】
- 密码password【部分登录】
- 打印店printers【部分登录】
- 学校school【无需登录】
- 分享share【部分登录】+
- 标签tags【部分登录】
- 订单task【必须登录】+
- 用户user【必须已登录】