mirror of
https://github.com/SocialSisterYi/bilibili-API-collect.git
synced 2025-01-14 22:00:07 +08:00
修正退出登录 api (#245)
This commit is contained in:
parent
5e3c4e5816
commit
c57e841e5f
@ -1,68 +1,69 @@
|
||||
# 退出账号登录
|
||||
|
||||
- [退出登录(web端)](#退出登录(web端))
|
||||
- [退出账号登录](#退出账号登录)
|
||||
- [退出登录(web 端)](#退出登录web-端)
|
||||
|
||||
---
|
||||
|
||||
## 退出登录(web端)
|
||||
## 退出登录(web 端)
|
||||
|
||||
> http://passport.bilibili.com/login?act=exit
|
||||
> https://passport.bilibili.com/login/exit/v2
|
||||
|
||||
*请求方式:GET*
|
||||
_请求方式:POST_
|
||||
|
||||
认证方式:仅可Cookie(SESSDATA)
|
||||
认证方式:Cookie
|
||||
|
||||
验证登录成功后会进行删除以下cookie项:
|
||||
验证登录成功后会进行删除以下 cookie 项:
|
||||
|
||||
`DedeUserID` `DedeUserID__ckMd5` `SESSDATA` `bili_jct`
|
||||
`DedeUserID` `DedeUserID__ckMd5` `SESSDATA` `bili_jct`
|
||||
|
||||
并在服务器注销该登录Token(SESSDATA),该Token即失效
|
||||
并在服务器注销该登录 Token(SESSDATA),该 Token 即失效
|
||||
|
||||
**回复:**
|
||||
**正文参数( application/x-www-form-urlencoded ):**
|
||||
|
||||
响应为一个用于跳转html页面
|
||||
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|
||||
| -------- | ---- | ------------------------- | --------------- | ---------------------------------- |
|
||||
| biliCSRF | str | CSRF Token(位于 cookie) | Cookie 方式必要 | |
|
||||
| gourl | str | 成功后跳转到的页面 | 非必要 | 默认为 `javascript:history.go(-1)` |
|
||||
|
||||
**json 回复:**
|
||||
|
||||
如果 cookie 已经失效则返回登录页面的 html 代码
|
||||
|
||||
根对象:
|
||||
|
||||
| 字段 | 类型 | 内容 | 备注 |
|
||||
| ------- | ------------------------------- | -------- | ---------------------------------- |
|
||||
| code | num | 返回值 | 0:成功 <br />-2202:csrf 请求非法 |
|
||||
| status | num/不存在 | 返回值 | true:成功,失败时可能不存在 |
|
||||
| ts | num | 返回值 | 时间戳(例如:1631796826) |
|
||||
| message | str<br />无效时:不存在 | 错误信息 | |
|
||||
| data | 有效时:obj<br />无效时:不存在 | 信息本体 | |
|
||||
|
||||
`data`对象:
|
||||
|
||||
redirectUrl 重定向 url
|
||||
|
||||
**示例:**
|
||||
|
||||
```shell
|
||||
curl 'http://passport.bilibili.com/login?act=exit' \
|
||||
-b 'SESSDATA=xxx;DedeUserID__ckMd5=xxx;SESSDATA=xxx;bili_jct=xxx'
|
||||
curl -X POST https://passport.bilibili.com/login/exit/v2 \
|
||||
-b "cookie字符串" \
|
||||
-d "biliCSRF=xxxxxx&gourl=https://www.bilibili.com"
|
||||
```
|
||||
|
||||
**响应头部抓包信息:**
|
||||
|
||||
使用set-cookie删除了以上cookie项
|
||||
|
||||
<details>
|
||||
<summary>查看响应示例:</summary>
|
||||
|
||||
```http
|
||||
HTTP/1.1 200 OK
|
||||
Date: Mon, 27 Jul 2020 13:42:21 GMT
|
||||
Content-Type: text/html;charset=UTF-8
|
||||
Transfer-Encoding: chunked
|
||||
Connection: keep-alive
|
||||
Server: Apache-Coyote/1.1
|
||||
Set-Cookie: SESSDATA=""; Domain=.bilibili.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
|
||||
Set-Cookie: SESSDATA__ckMd5=""; Domain=.bilibili.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: SESSDATA=""; Domain=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
|
||||
Set-Cookie: SESSDATA__ckMd5=""; Domain=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: DedeUserID=""; Domain=.bilibili.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: DedeUserID__ckMd5=""; Domain=.bilibili.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: DedeUserID=""; Domain=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: DedeUserID__ckMd5=""; Domain=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: bili_jct=""; Domain=.bilibili.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: bili_jct__ckMd5=""; Domain=.bilibili.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: bili_jct=""; Domain=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: bili_jct__ckMd5=""; Domain=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
|
||||
Set-Cookie: JSESSIONID=F857ED4084F8824BFDB4CD97EEC3D758; Path=/; HttpOnly
|
||||
Content-Language: zh-CN
|
||||
X-TKID: 1595857341658620367002
|
||||
Expires: Mon, 27 Jul 2020 13:42:20 GMT
|
||||
Cache-Control: no-cache
|
||||
X-Cache-Webcdn: BYPASS from jd-sxhz-dx-w-01
|
||||
Content-Encoding: gzip
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 0,
|
||||
"status": true,
|
||||
"ts": 1631796826,
|
||||
"data": {
|
||||
"redirectUrl": "https://passport.biligame.com/crossDomain?DedeUserID=&DedeUserID__ckMd5=&SESSDATA=&bili_jct=&gourl=https%3A%2F%2Fwww.bilibili.com"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
</details>
|
||||
|
Loading…
Reference in New Issue
Block a user