import{_ as s,c as e,a,o}from"./app-Dgsdh8A6.js";const l={};function n(d,t){return o(),e("div",null,t[0]||(t[0]=[a(`<h1 id="退出账号登录" tabindex="-1"><a class="header-anchor" href="#退出账号登录"><span>退出账号登录</span></a></h1><h2 id="退出登录-web端" tabindex="-1"><a class="header-anchor" href="#退出登录-web端"><span>退出登录(web端)</span></a></h2><blockquote><p>https://passport.bilibili.com/login/exit/v2</p></blockquote><p><em>请求方式：POST</em></p><p>认证方式：Cookie</p><p>验证登录成功后会使用<code>set-cookie</code>字段清空以下 cookie 项：</p><p><code>DedeUserID</code> <code>DedeUserID__ckMd5</code> <code>SESSDATA</code> <code>bili_jct</code></p><p>并在服务器注销该登录 Token (SESSDATA)，该 Token 即失效</p><p>请求必须包含以下cookie项：<code>DedeUserID</code> <code>bili_jct</code> <code>SESSDATA</code></p><p><strong>正文参数 (application/x-www-form-urlencoded)：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>biliCSRF</td><td>str</td><td>CSRF Token (位于 cookie 中的 <code>bili_jct</code>)</td><td>必要</td><td></td></tr><tr><td>gourl</td><td>str</td><td>成功后跳转到的页面</td><td>非必要</td><td>默认为<code>javascript:history.go(-1)</code></td></tr></tbody></table><p><strong>json 回复：</strong></p><p>如果 cookie 已经失效则输出登录页 html</p><p>根对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>code</td><td>num</td><td>返回值</td><td>0：成功 <br>2202：csrf 请求非法</td></tr><tr><td>status</td><td>bool</td><td>返回值</td><td><code>true</code>：成功</td></tr><tr><td>ts</td><td>num</td><td>时间戳</td><td></td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>成功时不存在</td></tr><tr><td>data</td><td>有效时：obj</td><td>信息本体</td><td>失败时不存在</td></tr></tbody></table><p><code>data</code>对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>redirectUrl</td><td>str</td><td>重定向 url</td><td></td></tr></tbody></table><p><strong>示例：</strong></p><div class="language-shell line-numbers-mode" data-highlighter="shiki" data-ext="shell" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-shell"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#569CD6;"> -L</span><span style="color:#569CD6;"> -X</span><span style="color:#CE9178;"> POST</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/login/exit/v2&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-H </span><span style="color:#CE9178;">&#39;Cookie: DedeUserID=xxx; bili_jct=xxx; SESSDATA=xxx&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">-H </span><span style="color:#CE9178;">&#39;Content-Type: application/x-www-form-urlencoded&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;biliCSRF=xxxxxx&#39;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><details><summary>查看响应示例：</summary><div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-json"><span class="line"><span style="color:#D4D4D4;">{</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;code&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;status&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#569CD6;">true</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;ts&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1663034005</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">  &quot;data&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;redirectUrl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;https://passport.biligame.com/crossDomain?DedeUserID=&amp;DedeUserID__ckMd5=&amp;SESSDATA=&amp;bili_jct=&amp;gourl=javascript%3Ahistory.go%28-1%29&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">  }</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></details>`,20)]))}const c=s(l,[["render",n]]),i=JSON.parse('{"path":"/docs/login/exit.html","title":"退出账号登录","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1677124138000,"contributors":[{"name":"SocialSisterYi","username":"SocialSisterYi","email":"1440239038@qq.com","commits":2,"url":"https://github.com/SocialSisterYi"}],"changelog":[{"hash":"f6760f4be38d5b592d396b211e48c666286524de","time":1677124138000,"email":"1440239038@qq.com","author":"SocialSisterYi","message":"🔨remove header index"},{"hash":"7d89ece2ac46425810647c4ac92acf5f3721cb68","time":1676998806000,"email":"1440239038@qq.com","author":"SocialSisterYi","message":"🚀调整项目结构"}]},"filePathRelative":"docs/login/exit.md"}');export{c as comp,i as data};
