import{_ as d,c as r,a as o,b as s,e as n,w as l,d as a,r as p,o as c}from"./app-Dgsdh8A6.js";const i={};function u(h,t){const e=p("RouteLink");return c(),r("div",null,[t[5]||(t[5]=o('<h1 id="登录操作" tabindex="-1"><a class="header-anchor" href="#登录操作"><span>登录操作</span></a></h1><p>人机验证方式登录包含<strong>账号密码登录</strong>与<strong>手机短信验证码登录</strong></p><p><strong>注：扫码登录</strong>不需要进行<strong>人机验证</strong>，故<strong>不使用</strong>以下接口</p><h2 id="扫码登录" tabindex="-1"><a class="header-anchor" href="#扫码登录"><span>扫码登录</span></a></h2>',4)),s("ul",null,[s("li",null,[n(e,{to:"/docs/login/login_action/QR.html"},{default:l(()=>t[0]||(t[0]=[a("扫码登录")])),_:1,__:[0]})])]),t[6]||(t[6]=o('<h2 id="验证登录" tabindex="-1"><a class="header-anchor" href="#验证登录"><span>验证登录</span></a></h2><p>人机验证流程：</p><ol><li>请求验证码参数，得到登录密钥<code>key</code>与极验id<code>gt</code>和极验KEY<code>challenge</code></li><li>进行滑动or点击验证</li><li>返回验证结果<code>validate</code>与<code>seccode</code>，进行短信或密码登录</li></ol><h3 id="申请captcha验证码" tabindex="-1"><a class="header-anchor" href="#申请captcha验证码"><span>申请captcha验证码</span></a></h3><blockquote><p>https://passport.bilibili.com/x/passport-login/captcha?source=main_web</p></blockquote><p><em>请求方式：GET</em></p>',6)),s("p",null,[t[2]||(t[2]=a("注: 另外参见 ")),n(e,{to:"/docs/login/login_action/password.html#%E8%8E%B7%E5%8F%96-captcha"},{default:l(()=>t[1]||(t[1]=[a("密码登录-手机号验证-获取 captcha")])),_:1,__:[1]})]),t[7]||(t[7]=o(`<p><strong>json回复：</strong></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：成功</td></tr><tr><td>message</td><td>str</td><td>返回信息</td><td></td></tr><tr><td>ttl</td><td>num</td><td>1</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>geetest</td><td>obj</td><td>极验captcha数据</td><td></td></tr><tr><td>tencent</td><td>obj</td><td>(?)</td><td><strong>作用尚不明确</strong></td></tr><tr><td>token</td><td>str</td><td>登录 API token</td><td>与 captcha 无关，与登录接口有关</td></tr><tr><td>type</td><td>str</td><td>验证方式</td><td>用于判断使用哪一种验证方式，目前所见只有极验<br>geetest：极验</td></tr></tbody></table><p><code>geetest</code>对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>gt</td><td>str</td><td>极验id</td><td>一般为固定值</td></tr><tr><td>challenge</td><td>str</td><td>极验KEY</td><td>由B站后端产生用于人机验证</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:#CE9178;"> &#39;https://passport.bilibili.com/x/passport-login/captcha?source=main_web&#39;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><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;message&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;0&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;ttl&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</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;type&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;geetest&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;token&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;00fbe75cc2864ba0af969231f193a974&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;geetest&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">            &quot;challenge&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;a57d9be17505d4a15ed84694c48fbf74&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">            &quot;gt&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;ac597a4506fee079629df5d8b66dd4fe&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">        },</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;tencent&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">            &quot;appid&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">        }</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 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><h3 id="申请captcha验证码-旧版" tabindex="-1"><a class="header-anchor" href="#申请captcha验证码-旧版"><span>申请captcha验证码 (旧版)</span></a></h3><blockquote><p>http://passport.bilibili.com/web/captcha/combine</p></blockquote><p><em>请求方式：GET</em></p><p>该接口曾从文档移除过, 经过测试仍可正常使用</p><p><strong>URL参数:</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>plat</td><td>num</td><td>平台类型</td><td>必要</td><td>默认为 6</td></tr></tbody></table><p><strong>JSON回复:</strong></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：成功</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>result</td><td>obj</td><td>套了个娃</td><td></td></tr><tr><td>type</td><td>num</td><td>1</td><td><strong>作用尚不明确</strong></td></tr></tbody></table><p><code>result</code>对象：</p><table><thead><tr><th>字段</th><th>类型</th><th>内容</th><th>备注</th></tr></thead><tbody><tr><td>success</td><td>num</td><td>1</td><td><strong>作用尚不明确</strong></td></tr><tr><td>gt</td><td>str</td><td>极验id</td><td>一般为固定值</td></tr><tr><td>challenge</td><td>str</td><td>极验KEY</td><td>由B站后端产生用于人机验证</td></tr><tr><td>key</td><td>str</td><td>登录秘钥</td><td>与 captcha 无关, 与登录接口有关, 亦作 token</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:#CE9178;"> &#39;https://passport.bilibili.com/web/captcha/combine?plat=6&#39;</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><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;data&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;result&quot;</span><span style="color:#D4D4D4;">: {</span></span>
<span class="line"><span style="color:#9CDCFE;">      &quot;success&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">      &quot;gt&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;bd111e81eda1cbb9f54425aafc0908ac&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">      &quot;challenge&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;2903a8eb967a1d990444cb23ea42f417&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">      &quot;key&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;76fb59fbd83a4d9d816162c5156fc964&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">    },</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;type&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1</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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></details><h3 id="进行验证" tabindex="-1"><a class="header-anchor" href="#进行验证"><span>进行验证</span></a></h3><p>本文档为 Bilibili 文档，验证码为 <a href="https://docs.geetest.com/sensebot/start/" target="_blank" rel="noopener noreferrer">geetest 极验</a> 提供，故不提供相关 API</p><p>附: <a href="https://kuresaru.github.io/geetest-validator/" target="_blank" rel="noopener noreferrer">手动验证器</a><a href="https://github.com/kuresaru/geetest-validator" target="_blank" rel="noopener noreferrer">及其源码</a></p><ol><li>打开手动验证器，在1、2分别填入上面API返回的<code>gt</code>和<code>challenge</code></li><li>点击按钮3，稍等加载验证码，点击按钮4进行验证</li><li>验证完成后，点击按钮5生成验证结果</li><li>使用最开始获得到的<code>key</code>、<code>challenge</code>和刚获得到的<code>validate</code>、<code>seccode</code>继续之后的登录操作</li></ol><h3 id="继续登录" tabindex="-1"><a class="header-anchor" href="#继续登录"><span>继续登录</span></a></h3>`,31)),s("ul",null,[s("li",null,[n(e,{to:"/docs/login/login_action/SMS.html"},{default:l(()=>t[3]||(t[3]=[a("短信登录")])),_:1,__:[3]})]),s("li",null,[n(e,{to:"/docs/login/login_action/password.html"},{default:l(()=>t[4]||(t[4]=[a("密码登录")])),_:1,__:[4]})])])])}const b=d(i,[["render",u]]),m=JSON.parse('{"path":"/docs/login/login_action/","title":"登录操作","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1724238159000,"contributors":[{"name":"SocialSisterYi","username":"SocialSisterYi","email":"1440239038@qq.com","commits":2,"url":"https://github.com/SocialSisterYi"},{"name":"SessionHu","username":"SessionHu","email":"102411014+SessionHu@users.noreply.github.com","commits":1,"url":"https://github.com/SessionHu"}],"changelog":[{"hash":"60a0c5d1a2f44fe61335da04571305fa7727a968","time":1724238159000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"feat: 各种接口补充与错误修正 (#1066)"},{"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/login_action/readme.md"}');export{b as comp,m as data};
