device-docking/爱牵挂/HA02-HA10/auth.md
2023-12-20 11:07:38 +08:00

31 lines
1.2 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

如果是post请求把参数带到body里面禁止写到URL后面。URL后面带参数的全是get请求。 我们的测试服虽然get和post请求都可以使用但是要是用规范改post请求的时候必须post请求并且把参数放到body下不要放到URL后面。我们的正式服因为换过架构所以会更加规范修改接口必须是post且放到body下进行请求
# 登录
- 地址: /api/auth/login
- 方法: POST
- 响应对象: [person](./object.md#person) *简化*
- 请求参数:
| 名称 | 必须 | 类型 | 说明 |
| ------------ | ---- | ------------ | ------------------------------ |
| username | 是 | string | 填用户名或手机号 |
| password | 是 | string | 填用户密码或短信密码 |
- 请求范例:
curl -v -A CURL -d "username=demo&password=admin" -c cookies.txt http://127.0.0.1:8888/api/auth/login
- 响应Cookie:
Set-Cookie: user="2|1:0|10:1407508841|4:user|8:YWRtaW4=|19bf2a8edd510eca173cecff546c446e3d800ae34ca3649ec56a566d2386e0de"; expires=Sun, 07 Sep 2014 14:40:41 GMT; Path=/
- 响应范例:
{
}