import{_ as e,c as a,a as n,o as l}from"./app-CDdN0tOz.js";const t={};function o(i,s){return l(),a("div",null,s[0]||(s[0]=[n(`<h1 id="检查昵称是否可注册" tabindex="-1"><a class="header-anchor" href="#检查昵称是否可注册"><span>检查昵称是否可注册</span></a></h1><h2 id="检查昵称-已失效" tabindex="-1"><a class="header-anchor" href="#检查昵称-已失效"><span><s>检查昵称（已失效）</s></span></a></h2><details><summary>查看折叠内容</summary><blockquote><p>https://passport.bilibili.com/web/generic/check/nickname</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>nickName</td><td>str</td><td>目标昵称</td><td>必要</td><td>最长为16字符</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>-400：请求错误<br>-500：服务器端异常<br><strong>详细说明见下一表格</strong></td></tr><tr><td>message</td><td>str</td><td>错误详情</td><td>若昵称可用，则不返回message</td></tr></tbody></table><p><code>code</code>状态码：</p><table><thead><tr><th>值</th><th>含义</th></tr></thead><tbody><tr><td>0</td><td>昵称未被注册</td></tr><tr><td>2001</td><td>该昵称已被他人使用</td></tr><tr><td>40002</td><td>昵称包含敏感信息</td></tr><tr><td>40004</td><td>昵称不可包含除-和_以外的特殊字符</td></tr><tr><td>40005</td><td>昵称过长（超过16字符）</td></tr><tr><td>40006</td><td>昵称过短（少于2字符）</td></tr><tr><td>40014</td><td>昵称已存在</td></tr></tbody></table><p><strong>示例：</strong></p><p>查询昵称 <code>xijinping</code> 是否被使用：</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;"> -G</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/web/generic/check/nickname&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;nickName=xijinping&#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></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;">40002</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;昵称包含敏感信息&quot;</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></div></details><p>查询昵称 <code>//</code> 是否被使用：</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;"> -G</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/web/generic/check/nickname&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;nickName=//&#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></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;">40004</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;昵称不可包含除-和_以外的特殊字符&quot;</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></div></details><p>查询昵称 <code>test0000000000000 </code> 是否被使用：</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;"> -G</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/web/generic/check/nickname&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;nickName=test0000000000000 &#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></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;">40005</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;昵称过长&quot;</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></div></details><p>查询昵称 <code>0</code> 是否被使用：</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;"> -G</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/web/generic/check/nickname&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;nickName=0&#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></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;">40006</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;昵称过短&quot;</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></div></details><p>查询昵称 <code>test</code> 是否被使用：</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;"> -G</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/web/generic/check/nickname&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#D4D4D4;">--data-urlencode </span><span style="color:#CE9178;">&#39;nickName=test&#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></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;">40014</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;昵称已存在&quot;</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></div></details></details><p>目前该接口无论参数，稳定返回：</p><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>
<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></div>`,5)]))}const r=e(t,[["render",o]]),d=JSON.parse('{"path":"/docs/user/check_nickname.html","title":"检查昵称是否可注册","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1737288326000,"contributors":[{"name":"SocialSisterYi","username":"SocialSisterYi","email":"1440239038@qq.com","commits":2,"url":"https://github.com/SocialSisterYi"},{"name":"emptyBud","username":"emptyBud","email":"74719559+emptyBud@users.noreply.github.com","commits":1,"url":"https://github.com/emptyBud"}],"changelog":[{"hash":"5e16f1c41d8c6a6487d9e690f0b33a6d5f072c12","time":1737288326000,"email":"74719559+emptyBud@users.noreply.github.com","author":"空芽","message":"Update check_nickname.md"},{"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/user/check_nickname.md"}');export{r as comp,d as data};
