import{_ as n,c as a,a as l,o as e}from"./app-CDdN0tOz.js";const o={};function p(t,s){return e(),a("div",null,s[0]||(s[0]=[l(`<h1 id="web端cookie刷新" tabindex="-1"><a class="header-anchor" href="#web端cookie刷新"><span>Web端Cookie刷新</span></a></h1><p>自从 2023 以来，社区反馈似乎 Web 端的 Cookie 会随着一些敏感接口的访问逐渐失效，而在 Web 页面上会判断 Cookie 是否需要刷新，如需刷新则会以动态加载 iframe 方式实现，同时登录（二维码 / 密码 / 短信验证码等）接口也会返回<code>refresh_token</code>字段，需要持久化保存，是一种官方的风控机制实现</p><p>感谢 <a href="https://github.com/SocialSisterYi/bilibili-API-collect/issues/524" target="_blank" rel="noopener noreferrer">#524</a> 提供相关研究报告以及逆向工程结果</p><blockquote><p>cookie 不会主动刷新的，只要他没有调用下面的刷新接口就不会刷新。也就是说，你只要不再打开浏览器，或者直接把 localStorage 的 ac_time_value 字段删除了。那么 cookie 在真的失效前（登录过期、账号风控等强制下线）都是不变化的。</p></blockquote><h2 id="刷新步骤-伪代码" tabindex="-1"><a class="header-anchor" href="#刷新步骤-伪代码"><span>刷新步骤（伪代码）</span></a></h2><div class="language-python line-numbers-mode" data-highlighter="shiki" data-ext="python" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-python"><span class="line"><span style="color:#D4D4D4;">cookie, refresh_token = 进行登录操作() </span><span style="color:#6A9955;"># can be 二维码 / 密码 / 短信验证码</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C586C0;">while</span><span style="color:#569CD6;"> True</span><span style="color:#D4D4D4;">:</span></span>
<span class="line"><span style="color:#C586C0;">    if</span><span style="color:#D4D4D4;"> 每日第一次访问接口:</span></span>
<span class="line"><span style="color:#C586C0;">        if</span><span style="color:#D4D4D4;"> 检查是否需要刷新(cookie):</span></span>
<span class="line"><span style="color:#D4D4D4;">            CorrespondPath = 生成CorrespondPath(当前毫秒时间戳)</span></span>
<span class="line"><span style="color:#D4D4D4;">            refresh_csrf = 获取refresh_csrf(CorrespondPath, cookie)</span></span>
<span class="line"><span style="color:#D4D4D4;">            refresh_token_old = refresh_token </span><span style="color:#6A9955;"># 这一步必须保存旧的 refresh_token 备用</span></span>
<span class="line"><span style="color:#D4D4D4;">            cookie, refresh_token = 刷新Cookie(refresh_token, refresh_csrf, cookie)</span></span>
<span class="line"><span style="color:#D4D4D4;">            确认更新(refresh_token_old, cookie) </span><span style="color:#6A9955;"># 这一步需要新的 Cookie 以及旧的 refresh_token</span></span>
<span class="line"><span style="color:#D4D4D4;">            SSO站点跨域登录(cookie)</span></span>
<span class="line"><span style="color:#D4D4D4;">    do_somethings(cookie) </span><span style="color:#6A9955;"># 其他业务逻辑处理</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><h2 id="检查是否需要刷新" tabindex="-1"><a class="header-anchor" href="#检查是否需要刷新"><span>检查是否需要刷新</span></a></h2><blockquote><p>https://passport.bilibili.com/x/passport-login/web/cookie/info</p></blockquote><p><em>请求方式：GET</em></p><p>鉴权方式：Cookie</p><p><strong>url 参数：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>csrf</td><td>str</td><td>CSRF Token（位于 Cookie）</td><td>非必要</td><td>位于 Cookie 中的bili_jct字段</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：成功<br>-101：账号未登录</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为 0</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>refresh</td><td>bool</td><td>是否应该刷新 Cookie</td><td><code>true</code>：需要刷新 Cookie<br><code>false</code>：无需刷新 Cookie</td></tr><tr><td>timestamp</td><td>num</td><td>当前毫秒时间戳</td><td>用于获取 refresh_csrf</td></tr></tbody></table><p><strong>示例：</strong></p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-bash"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#569CD6;"> -G</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/x/passport-login/web/cookie/info&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &#39;csrf=xxx&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	-b</span><span style="color:#CE9178;"> &#39;SESSDATA=xxx&#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></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;refresh&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#569CD6;">false</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;timestamp&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#B5CEA8;">1684466082562</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></div></details><h2 id="生成correspondpath算法" tabindex="-1"><a class="header-anchor" href="#生成correspondpath算法"><span>生成CorrespondPath算法</span></a></h2><p>该算法逆向于以下 wasm 以及 JavaScript bind 接口，抓取于官方 Web 首页中，感谢 <a href="https://github.com/SocialSisterYi/bilibili-API-collect/issues/524" target="_blank" rel="noopener noreferrer">#524</a> 提供</p><p>https://s1.hdslb.com/bfs/static/jinkela/long/wasm/wasm_rsa_encrypt_bg.wasm</p><p>https://s1.hdslb.com/bfs/static/jinkela/long/wasm/wasm_ras_umd.js</p><h3 id="算法细节" tabindex="-1"><a class="header-anchor" href="#算法细节"><span>算法细节</span></a></h3><p>将<code>refresh_\${timestamp}</code>作为消息体（参数<code>timestamp</code>为当前毫秒时间戳），用下方 PubKey 进行 <a href="https://datatracker.ietf.org/doc/html/rfc3447#section-7.1" target="_blank" rel="noopener noreferrer">RSA-OAEP</a> 算法加密，之后密文通过小写 Base16 编码为字符串</p><p>JWK 格式：</p><blockquote><p>{ &quot;kty&quot;: &quot;RSA&quot;, &quot;n&quot;: &quot;y4HdjgJHBlbaBN04VERG4qNBIFHP6a3GozCl75AihQloSWCXC5HDNgyinEnhaQ_4-gaMud_GF50elYXLlCToR9se9Z8z433U3KjM-3Yx7ptKkmQNAMggQwAVKgq3zYAoidNEWuxpkY_mAitTSRLnsJW-NCTa0bqBFF6Wm1MxgfE&quot;, &quot;e&quot;: &quot;AQAB&quot; }</p></blockquote><p>PEM 格式：</p><blockquote><p>-----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLgd2OAkcGVtoE3ThUREbio0Eg Uc/prcajMKXvkCKFCWhJYJcLkcM2DKKcSeFpD/j6Boy538YXnR6VhcuUJOhH2x71 nzPjfdTcqMz7djHum0qSZA0AyCBDABUqCrfNgCiJ00Ra7GmRj+YCK1NJEuewlb40 JNrRuoEUXpabUzGB8QIDAQAB -----END PUBLIC KEY-----</p></blockquote><h3 id="相关demo" tabindex="-1"><a class="header-anchor" href="#相关demo"><span>相关Demo</span></a></h3><p>该 Demo 提供 <a href="#javascript">JavaScript</a> <a href="#python">Python</a> <a href="#kotlin">Kotlin</a> <a href="#java">Java</a> <a href="#go">Go</a> 以及 <a href="#vercel%E4%BA%91%E5%87%BD%E6%95%B0">Vercel 云函数</a>，感谢 <a href="https://github.com/SocialSisterYi/bilibili-API-collect/issues/524" target="_blank" rel="noopener noreferrer">#524</a> 提供</p><h4 id="javascript" tabindex="-1"><a class="header-anchor" href="#javascript"><span>JavaScript</span></a></h4><div class="language-javascript line-numbers-mode" data-highlighter="shiki" data-ext="javascript" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-javascript"><span class="line"><span style="color:#569CD6;">const</span><span style="color:#4FC1FF;"> publicKey</span><span style="color:#D4D4D4;"> = </span><span style="color:#C586C0;">await</span><span style="color:#9CDCFE;"> crypto</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">subtle</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">importKey</span><span style="color:#D4D4D4;">(</span></span>
<span class="line"><span style="color:#CE9178;">  &quot;jwk&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#D4D4D4;">  {</span></span>
<span class="line"><span style="color:#9CDCFE;">    kty:</span><span style="color:#CE9178;"> &quot;RSA&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    n:</span><span style="color:#CE9178;"> &quot;y4HdjgJHBlbaBN04VERG4qNBIFHP6a3GozCl75AihQloSWCXC5HDNgyinEnhaQ_4-gaMud_GF50elYXLlCToR9se9Z8z433U3KjM-3Yx7ptKkmQNAMggQwAVKgq3zYAoidNEWuxpkY_mAitTSRLnsJW-NCTa0bqBFF6Wm1MxgfE&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    e:</span><span style="color:#CE9178;"> &quot;AQAB&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#D4D4D4;">  },</span></span>
<span class="line"><span style="color:#D4D4D4;">  { </span><span style="color:#9CDCFE;">name:</span><span style="color:#CE9178;"> &quot;RSA-OAEP&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">hash:</span><span style="color:#CE9178;"> &quot;SHA-256&quot;</span><span style="color:#D4D4D4;"> },</span></span>
<span class="line"><span style="color:#569CD6;">  true</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#D4D4D4;">  [</span><span style="color:#CE9178;">&quot;encrypt&quot;</span><span style="color:#D4D4D4;">],</span></span>
<span class="line"><span style="color:#D4D4D4;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">async</span><span style="color:#569CD6;"> function</span><span style="color:#DCDCAA;"> getCorrespondPath</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">timestamp</span><span style="color:#D4D4D4;">) {</span></span>
<span class="line"><span style="color:#569CD6;">  const</span><span style="color:#4FC1FF;"> data</span><span style="color:#D4D4D4;"> = </span><span style="color:#569CD6;">new</span><span style="color:#DCDCAA;"> TextEncoder</span><span style="color:#D4D4D4;">().</span><span style="color:#DCDCAA;">encode</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">\`refresh_</span><span style="color:#569CD6;">\${</span><span style="color:#9CDCFE;">timestamp</span><span style="color:#569CD6;">}</span><span style="color:#CE9178;">\`</span><span style="color:#D4D4D4;">);</span></span>
<span class="line"><span style="color:#569CD6;">  const</span><span style="color:#4FC1FF;"> encrypted</span><span style="color:#D4D4D4;"> = </span><span style="color:#569CD6;">new</span><span style="color:#DCDCAA;"> Uint8Array</span><span style="color:#D4D4D4;">(</span><span style="color:#C586C0;">await</span><span style="color:#9CDCFE;"> crypto</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">subtle</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">encrypt</span><span style="color:#D4D4D4;">({ </span><span style="color:#9CDCFE;">name:</span><span style="color:#CE9178;"> &quot;RSA-OAEP&quot;</span><span style="color:#D4D4D4;"> }, </span><span style="color:#9CDCFE;">publicKey</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">data</span><span style="color:#D4D4D4;">))</span></span>
<span class="line"><span style="color:#C586C0;">  return</span><span style="color:#9CDCFE;"> encrypted</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">reduce</span><span style="color:#D4D4D4;">((</span><span style="color:#9CDCFE;">str</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">c</span><span style="color:#D4D4D4;">) </span><span style="color:#569CD6;">=&gt;</span><span style="color:#9CDCFE;"> str</span><span style="color:#D4D4D4;"> + </span><span style="color:#9CDCFE;">c</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">toString</span><span style="color:#D4D4D4;">(</span><span style="color:#B5CEA8;">16</span><span style="color:#D4D4D4;">).</span><span style="color:#DCDCAA;">padStart</span><span style="color:#D4D4D4;">(</span><span style="color:#B5CEA8;">2</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;0&quot;</span><span style="color:#D4D4D4;">), </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">const</span><span style="color:#4FC1FF;"> ts</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">Date</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">now</span><span style="color:#D4D4D4;">()</span></span>
<span class="line"><span style="color:#9CDCFE;">console</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">log</span><span style="color:#D4D4D4;">(</span><span style="color:#C586C0;">await</span><span style="color:#DCDCAA;"> getCorrespondPath</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">ts</span><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 class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-text"><span class="line"><span>b77f21ab5b7ce7879c410b2311dd6e7ea1a2cd1cd941073db067f4c3279fdabca3a06dfa744168ee14ad050b9f4889bd4edb8e76eb597fdd18c16804d82566b55c6dba8e225d838aa93d8e5b31cf7c56720db8244d92373f4944e0561f6ca5bf721a36ac079786060fc853605ccd1ddcb33f54617de6aedd44e3b9850d13b45f</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h4 id="python" tabindex="-1"><a class="header-anchor" href="#python"><span>Python</span></a></h4><p>需要<code>pycryptodome</code>依赖</p><div class="language-python line-numbers-mode" data-highlighter="shiki" data-ext="python" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-python"><span class="line"><span style="color:#C586C0;">from</span><span style="color:#D4D4D4;"> Crypto.Cipher </span><span style="color:#C586C0;">import</span><span style="color:#D4D4D4;"> PKCS1_OAEP</span></span>
<span class="line"><span style="color:#C586C0;">from</span><span style="color:#D4D4D4;"> Crypto.PublicKey </span><span style="color:#C586C0;">import</span><span style="color:#D4D4D4;"> RSA</span></span>
<span class="line"><span style="color:#C586C0;">from</span><span style="color:#D4D4D4;"> Crypto.Hash </span><span style="color:#C586C0;">import</span><span style="color:#D4D4D4;"> SHA256</span></span>
<span class="line"><span style="color:#C586C0;">import</span><span style="color:#D4D4D4;"> binascii</span></span>
<span class="line"><span style="color:#C586C0;">import</span><span style="color:#D4D4D4;"> time</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D4D4D4;">key = RSA.importKey(</span><span style="color:#CE9178;">&#39;&#39;&#39;</span><span style="color:#569CD6;">\\</span></span>
<span class="line"><span style="color:#CE9178;">-----BEGIN PUBLIC KEY-----</span></span>
<span class="line"><span style="color:#CE9178;">MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLgd2OAkcGVtoE3ThUREbio0Eg</span></span>
<span class="line"><span style="color:#CE9178;">Uc/prcajMKXvkCKFCWhJYJcLkcM2DKKcSeFpD/j6Boy538YXnR6VhcuUJOhH2x71</span></span>
<span class="line"><span style="color:#CE9178;">nzPjfdTcqMz7djHum0qSZA0AyCBDABUqCrfNgCiJ00Ra7GmRj+YCK1NJEuewlb40</span></span>
<span class="line"><span style="color:#CE9178;">JNrRuoEUXpabUzGB8QIDAQAB</span></span>
<span class="line"><span style="color:#CE9178;">-----END PUBLIC KEY-----&#39;&#39;&#39;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">def</span><span style="color:#DCDCAA;"> getCorrespondPath</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">ts</span><span style="color:#D4D4D4;">):</span></span>
<span class="line"><span style="color:#D4D4D4;">    cipher = PKCS1_OAEP.new(key, SHA256)</span></span>
<span class="line"><span style="color:#D4D4D4;">    encrypted = cipher.encrypt(</span><span style="color:#569CD6;">f</span><span style="color:#CE9178;">&#39;refresh_</span><span style="color:#569CD6;">{</span><span style="color:#D4D4D4;">ts</span><span style="color:#569CD6;">}</span><span style="color:#CE9178;">&#39;</span><span style="color:#D4D4D4;">.encode())</span></span>
<span class="line"><span style="color:#C586C0;">    return</span><span style="color:#D4D4D4;"> binascii.b2a_hex(encrypted).decode()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D4D4D4;">ts = </span><span style="color:#DCDCAA;">round</span><span style="color:#D4D4D4;">(time.time() * </span><span style="color:#B5CEA8;">1000</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#DCDCAA;">print</span><span style="color:#D4D4D4;">(getCorrespondPath(ts))</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 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><div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-text"><span class="line"><span>47bbd615f333d6a2c597bbb46ad47a6e59752a305a2f545d3ba5d49ca055309347796f80d257613696d36170c57443a0e9dea2b47f83b0b4224d431e46124fadd9a24c8fa468147e8bf2d2501eaacae43310e19bf58fc4a728d80c90b9401afcfc1536ba9a2f6438ea53c0b2652f8b8d01c87355dd5a5da51de998b1a35d519a</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h3 id="kotlin" tabindex="-1"><a class="header-anchor" href="#kotlin"><span>Kotlin</span></a></h3><div class="language-kotlin line-numbers-mode" data-highlighter="shiki" data-ext="kotlin" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-kotlin"><span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.security.KeyFactory</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.security.spec.MGF1ParameterSpec</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.security.spec.X509EncodedKeySpec</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.util.</span><span style="color:#569CD6;">*</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> javax.crypto.Cipher</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> javax.crypto.spec.OAEPParameterSpec</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> javax.crypto.spec.PSource</span></span>
<span class="line"></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">fun</span><span style="color:#DCDCAA;"> main</span><span style="color:#D4D4D4;">() {</span></span>
<span class="line"><span style="color:#DCDCAA;">    println</span><span style="color:#D4D4D4;">(</span><span style="color:#DCDCAA;">getCorrespondPath</span><span style="color:#D4D4D4;">(System.</span><span style="color:#DCDCAA;">currentTimeMillis</span><span style="color:#D4D4D4;">()))</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">fun</span><span style="color:#DCDCAA;"> getCorrespondPath</span><span style="color:#D4D4D4;">(timestamp: </span><span style="color:#4EC9B0;">Long</span><span style="color:#D4D4D4;">): </span><span style="color:#4EC9B0;">String</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#569CD6;">    val</span><span style="color:#D4D4D4;"> publicKeyPEM = </span><span style="color:#CE9178;">&quot;&quot;&quot;</span></span>
<span class="line"><span style="color:#CE9178;">        -----BEGIN PUBLIC KEY-----</span></span>
<span class="line"><span style="color:#CE9178;">        MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLgd2OAkcGVtoE3ThUREbio0Eg</span></span>
<span class="line"><span style="color:#CE9178;">        Uc/prcajMKXvkCKFCWhJYJcLkcM2DKKcSeFpD/j6Boy538YXnR6VhcuUJOhH2x71</span></span>
<span class="line"><span style="color:#CE9178;">        nzPjfdTcqMz7djHum0qSZA0AyCBDABUqCrfNgCiJ00Ra7GmRj+YCK1NJEuewlb40</span></span>
<span class="line"><span style="color:#CE9178;">        JNrRuoEUXpabUzGB8QIDAQAB</span></span>
<span class="line"><span style="color:#CE9178;">        -----END PUBLIC KEY-----</span></span>
<span class="line"><span style="color:#CE9178;">    &quot;&quot;&quot;</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">trimIndent</span><span style="color:#D4D4D4;">()</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">    val</span><span style="color:#D4D4D4;"> publicKey = KeyFactory.</span><span style="color:#DCDCAA;">getInstance</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;RSA&quot;</span><span style="color:#D4D4D4;">).</span><span style="color:#DCDCAA;">generatePublic</span><span style="color:#D4D4D4;">(</span></span>
<span class="line"><span style="color:#DCDCAA;">        X509EncodedKeySpec</span><span style="color:#D4D4D4;">(Base64.</span><span style="color:#DCDCAA;">getDecoder</span><span style="color:#D4D4D4;">().</span><span style="color:#DCDCAA;">decode</span><span style="color:#D4D4D4;">(publicKeyPEM</span></span>
<span class="line"><span style="color:#D4D4D4;">            .</span><span style="color:#DCDCAA;">replace</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;-----BEGIN PUBLIC KEY-----&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">            .</span><span style="color:#DCDCAA;">replace</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;-----END PUBLIC KEY-----&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">            .</span><span style="color:#DCDCAA;">replace</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;</span><span style="color:#D7BA7D;">\\n</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">            .</span><span style="color:#DCDCAA;">trim</span><span style="color:#D4D4D4;">()))</span></span>
<span class="line"><span style="color:#D4D4D4;">    )</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">    val</span><span style="color:#D4D4D4;"> cipher = Cipher.</span><span style="color:#DCDCAA;">getInstance</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;RSA/ECB/OAEPPadding&quot;</span><span style="color:#D4D4D4;">).</span><span style="color:#DCDCAA;">apply</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#569CD6;">        init</span><span style="color:#D4D4D4;">(Cipher.ENCRYPT_MODE,</span></span>
<span class="line"><span style="color:#D4D4D4;">            publicKey,</span></span>
<span class="line"><span style="color:#DCDCAA;">            OAEPParameterSpec</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;SHA-256&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;MGF1&quot;</span><span style="color:#D4D4D4;">, MGF1ParameterSpec.SHA256, PSource.PSpecified.DEFAULT)</span></span>
<span class="line"><span style="color:#D4D4D4;">        )</span></span>
<span class="line"><span style="color:#D4D4D4;">    }</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C586C0;">    return</span><span style="color:#D4D4D4;"> cipher.</span><span style="color:#DCDCAA;">doFinal</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;refresh_</span><span style="color:#9CDCFE;">$timestamp</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">toByteArray</span><span style="color:#D4D4D4;">()).</span><span style="color:#DCDCAA;">joinToString</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">) { </span><span style="color:#CE9178;">&quot;%02x&quot;</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">format</span><span style="color:#D4D4D4;">(it) }</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 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 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><div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-text"><span class="line"><span>1428cbd14605ae42a0b42e22662cfe51d8e5034eeaffb36a46db46bd2f93216cbfd4d150cca2de44395add7c664b40acf44424ee8d634fc821b909423665a34d18bd7f4e77ea5388a2b612daf875e2fe8df62990e14b64a465898b0707bc1288586b68f9f4f2f20bea5cb1cada296beb8009e91bc8fb57a4b81b8923299b6eb7</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h3 id="go" tabindex="-1"><a class="header-anchor" href="#go"><span>Go</span></a></h3><div class="language-go line-numbers-mode" data-highlighter="shiki" data-ext="go" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-go"><span class="line"><span style="color:#569CD6;">package</span><span style="color:#4EC9B0;"> main</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C586C0;">import</span><span style="color:#D4D4D4;"> (</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;crypto/rand&quot;</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;crypto/rsa&quot;</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;crypto/sha256&quot;</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;crypto/x509&quot;</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;encoding/hex&quot;</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;encoding/pem&quot;</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;fmt&quot;</span></span>
<span class="line"><span style="color:#CE9178;">	&quot;time&quot;</span></span>
<span class="line"><span style="color:#D4D4D4;">)</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">func</span><span style="color:#DCDCAA;"> main</span><span style="color:#D4D4D4;">() {</span></span>
<span class="line"><span style="color:#9CDCFE;">	result</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">err</span><span style="color:#D4D4D4;"> := </span><span style="color:#DCDCAA;">getCorrespondPath</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">time</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">Now</span><span style="color:#D4D4D4;">().</span><span style="color:#DCDCAA;">UnixMilli</span><span style="color:#D4D4D4;">())</span></span>
<span class="line"><span style="color:#C586C0;">	if</span><span style="color:#9CDCFE;"> err</span><span style="color:#D4D4D4;"> != </span><span style="color:#569CD6;">nil</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#DCDCAA;">		panic</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">err</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">	}</span></span>
<span class="line"><span style="color:#9CDCFE;">	fmt</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">Println</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">result</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">func</span><span style="color:#DCDCAA;"> getCorrespondPath</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">ts</span><span style="color:#4EC9B0;"> int64</span><span style="color:#D4D4D4;">) (</span><span style="color:#4EC9B0;">string</span><span style="color:#D4D4D4;">, </span><span style="color:#4EC9B0;">error</span><span style="color:#D4D4D4;">) {</span></span>
<span class="line"><span style="color:#569CD6;">	const</span><span style="color:#4FC1FF;"> publicKeyPEM</span><span style="color:#D4D4D4;"> = </span><span style="color:#CE9178;">\`</span></span>
<span class="line"><span style="color:#CE9178;">-----BEGIN PUBLIC KEY-----</span></span>
<span class="line"><span style="color:#CE9178;">MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLgd2OAkcGVtoE3ThUREbio0Eg</span></span>
<span class="line"><span style="color:#CE9178;">Uc/prcajMKXvkCKFCWhJYJcLkcM2DKKcSeFpD/j6Boy538YXnR6VhcuUJOhH2x71</span></span>
<span class="line"><span style="color:#CE9178;">nzPjfdTcqMz7djHum0qSZA0AyCBDABUqCrfNgCiJ00Ra7GmRj+YCK1NJEuewlb40</span></span>
<span class="line"><span style="color:#CE9178;">JNrRuoEUXpabUzGB8QIDAQAB</span></span>
<span class="line"><span style="color:#CE9178;">-----END PUBLIC KEY-----</span></span>
<span class="line"><span style="color:#CE9178;">\`</span></span>
<span class="line"><span style="color:#9CDCFE;">	pubKeyBlock</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">_</span><span style="color:#D4D4D4;"> := </span><span style="color:#9CDCFE;">pem</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">Decode</span><span style="color:#D4D4D4;">([]</span><span style="color:#4EC9B0;">byte</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">publicKeyPEM</span><span style="color:#D4D4D4;">))</span></span>
<span class="line"><span style="color:#9CDCFE;">	hash</span><span style="color:#D4D4D4;"> := </span><span style="color:#9CDCFE;">sha256</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">New</span><span style="color:#D4D4D4;">()</span></span>
<span class="line"><span style="color:#9CDCFE;">	random</span><span style="color:#D4D4D4;"> := </span><span style="color:#9CDCFE;">rand</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">Reader</span></span>
<span class="line"><span style="color:#9CDCFE;">	msg</span><span style="color:#D4D4D4;"> := []</span><span style="color:#4EC9B0;">byte</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">fmt</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">Sprintf</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;refresh_</span><span style="color:#9CDCFE;">%d</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">ts</span><span style="color:#D4D4D4;">))</span></span>
<span class="line"><span style="color:#569CD6;">	var</span><span style="color:#9CDCFE;"> pub</span><span style="color:#D4D4D4;"> *</span><span style="color:#4EC9B0;">rsa</span><span style="color:#D4D4D4;">.</span><span style="color:#4EC9B0;">PublicKey</span></span>
<span class="line"><span style="color:#9CDCFE;">	pubInterface</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">parseErr</span><span style="color:#D4D4D4;"> := </span><span style="color:#9CDCFE;">x509</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">ParsePKIXPublicKey</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">pubKeyBlock</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">Bytes</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#C586C0;">	if</span><span style="color:#9CDCFE;"> parseErr</span><span style="color:#D4D4D4;"> != </span><span style="color:#569CD6;">nil</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#C586C0;">		return</span><span style="color:#CE9178;"> &quot;&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">parseErr</span></span>
<span class="line"><span style="color:#D4D4D4;">	}</span></span>
<span class="line"><span style="color:#9CDCFE;">	pub</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">pubInterface</span><span style="color:#D4D4D4;">.(*</span><span style="color:#4EC9B0;">rsa</span><span style="color:#D4D4D4;">.</span><span style="color:#4EC9B0;">PublicKey</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#9CDCFE;">	encryptedData</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">encryptErr</span><span style="color:#D4D4D4;"> := </span><span style="color:#9CDCFE;">rsa</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">EncryptOAEP</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">hash</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">random</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">pub</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">msg</span><span style="color:#D4D4D4;">, </span><span style="color:#569CD6;">nil</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#C586C0;">	if</span><span style="color:#9CDCFE;"> encryptErr</span><span style="color:#D4D4D4;"> != </span><span style="color:#569CD6;">nil</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#C586C0;">		return</span><span style="color:#CE9178;"> &quot;&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">encryptErr</span></span>
<span class="line"><span style="color:#D4D4D4;">	}</span></span>
<span class="line"><span style="color:#C586C0;">	return</span><span style="color:#9CDCFE;"> hex</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">EncodeToString</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">encryptedData</span><span style="color:#D4D4D4;">), </span><span style="color:#569CD6;">nil</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 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 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><div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-text"><span class="line"><span>97759947aa357ed5d88cf9bf1172737570b7bba2d6788d39006f082b2b25ddf53b581f1f0c61ed8573317485ef525d2789faa25a277b4602a4b9cbf837681093a03e96cb9773a11df4bb1e20f1587180b3e958194de922d7dd94d0a2f0b9b0ef74e426e8041f99b99e7c02407ef4ab38040e61be81e4fdfbdb73461e3a2ad810</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h3 id="java" tabindex="-1"><a class="header-anchor" href="#java"><span>Java</span></a></h3><div class="language-java line-numbers-mode" data-highlighter="shiki" data-ext="java" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-java"><span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> javax.crypto.Cipher;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> javax.crypto.spec.OAEPParameterSpec;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> javax.crypto.spec.PSource;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.math.BigInteger;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.security.KeyFactory;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.security.PublicKey;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.security.spec.MGF1ParameterSpec;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.security.spec.X509EncodedKeySpec;</span></span>
<span class="line"><span style="color:#569CD6;">import</span><span style="color:#D4D4D4;"> java.util.Base64;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">public</span><span style="color:#569CD6;"> class</span><span style="color:#4EC9B0;"> CookieRefresh</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#569CD6;">    private</span><span style="color:#569CD6;"> static</span><span style="color:#569CD6;"> final</span><span style="color:#4EC9B0;"> String</span><span style="color:#9CDCFE;"> PUBLIC_KEY</span><span style="color:#D4D4D4;"> = </span><span style="color:#CE9178;">&quot;-----BEGIN PUBLIC KEY-----</span><span style="color:#D7BA7D;">\\n</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;"> +</span></span>
<span class="line"><span style="color:#CE9178;">            &quot;MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLgd2OAkcGVtoE3ThUREbio0Eg</span><span style="color:#D7BA7D;">\\n</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;"> +</span></span>
<span class="line"><span style="color:#CE9178;">            &quot;Uc/prcajMKXvkCKFCWhJYJcLkcM2DKKcSeFpD/j6Boy538YXnR6VhcuUJOhH2x71</span><span style="color:#D7BA7D;">\\n</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;"> +</span></span>
<span class="line"><span style="color:#CE9178;">            &quot;nzPjfdTcqMz7djHum0qSZA0AyCBDABUqCrfNgCiJ00Ra7GmRj+YCK1NJEuewlb40</span><span style="color:#D7BA7D;">\\n</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;"> +</span></span>
<span class="line"><span style="color:#CE9178;">            &quot;JNrRuoEUXpabUzGB8QIDAQAB</span><span style="color:#D7BA7D;">\\n</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;"> +</span></span>
<span class="line"><span style="color:#CE9178;">            &quot;-----END PUBLIC KEY-----&quot;</span><span style="color:#D4D4D4;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">    public</span><span style="color:#569CD6;"> static</span><span style="color:#4EC9B0;"> void</span><span style="color:#DCDCAA;"> main</span><span style="color:#D4D4D4;">(</span><span style="color:#4EC9B0;">String</span><span style="color:#D4D4D4;">[] </span><span style="color:#9CDCFE;">args</span><span style="color:#D4D4D4;">) {</span></span>
<span class="line"><span style="color:#C586C0;">        try</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#4EC9B0;">            String</span><span style="color:#9CDCFE;"> correspondPath</span><span style="color:#D4D4D4;"> = </span><span style="color:#DCDCAA;">getCorrespondPath</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">String</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">format</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;refresh_%d&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">System</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">currentTimeMillis</span><span style="color:#D4D4D4;">()), PUBLIC_KEY);</span></span>
<span class="line"><span style="color:#9CDCFE;">            System</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">out</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">println</span><span style="color:#D4D4D4;">(correspondPath);</span></span>
<span class="line"><span style="color:#D4D4D4;">        } </span><span style="color:#C586C0;">catch</span><span style="color:#D4D4D4;"> (</span><span style="color:#4EC9B0;">Exception</span><span style="color:#9CDCFE;"> e</span><span style="color:#D4D4D4;">) {</span></span>
<span class="line"><span style="color:#9CDCFE;">            e</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">printStackTrace</span><span style="color:#D4D4D4;">();</span></span>
<span class="line"><span style="color:#D4D4D4;">        }</span></span>
<span class="line"><span style="color:#D4D4D4;">    }</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">    public</span><span style="color:#569CD6;"> static</span><span style="color:#4EC9B0;"> String</span><span style="color:#DCDCAA;"> getCorrespondPath</span><span style="color:#D4D4D4;">(</span><span style="color:#4EC9B0;">String</span><span style="color:#9CDCFE;"> plaintext</span><span style="color:#D4D4D4;">, </span><span style="color:#4EC9B0;">String</span><span style="color:#9CDCFE;"> publicKeyStr</span><span style="color:#D4D4D4;">) </span><span style="color:#569CD6;">throws</span><span style="color:#4EC9B0;"> Exception</span><span style="color:#D4D4D4;"> {</span></span>
<span class="line"><span style="color:#4EC9B0;">        KeyFactory</span><span style="color:#9CDCFE;"> keyFactory</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">KeyFactory</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">getInstance</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;RSA&quot;</span><span style="color:#D4D4D4;">);</span></span>
<span class="line"><span style="color:#D4D4D4;">        publicKeyStr = publicKeyStr</span></span>
<span class="line"><span style="color:#D4D4D4;">                .</span><span style="color:#DCDCAA;">replace</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;-----BEGIN PUBLIC KEY-----&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">                .</span><span style="color:#DCDCAA;">replace</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;-----END PUBLIC KEY-----&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">                .</span><span style="color:#DCDCAA;">replace</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;</span><span style="color:#D7BA7D;">\\n</span><span style="color:#CE9178;">&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">)</span></span>
<span class="line"><span style="color:#D4D4D4;">                .</span><span style="color:#DCDCAA;">trim</span><span style="color:#D4D4D4;">();</span></span>
<span class="line"><span style="color:#4EC9B0;">        byte</span><span style="color:#D4D4D4;">[] </span><span style="color:#9CDCFE;">publicBytes</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">Base64</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">getDecoder</span><span style="color:#D4D4D4;">().</span><span style="color:#DCDCAA;">decode</span><span style="color:#D4D4D4;">(publicKeyStr);</span></span>
<span class="line"><span style="color:#4EC9B0;">        X509EncodedKeySpec</span><span style="color:#9CDCFE;"> x509EncodedKeySpec</span><span style="color:#D4D4D4;"> = </span><span style="color:#C586C0;">new</span><span style="color:#DCDCAA;"> X509EncodedKeySpec</span><span style="color:#D4D4D4;">(publicBytes);</span></span>
<span class="line"><span style="color:#4EC9B0;">        PublicKey</span><span style="color:#9CDCFE;"> publicKey</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">keyFactory</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">generatePublic</span><span style="color:#D4D4D4;">(x509EncodedKeySpec);</span></span>
<span class="line"></span>
<span class="line"><span style="color:#4EC9B0;">        String</span><span style="color:#9CDCFE;"> algorithm</span><span style="color:#D4D4D4;"> = </span><span style="color:#CE9178;">&quot;RSA/ECB/OAEPPadding&quot;</span><span style="color:#D4D4D4;">;</span></span>
<span class="line"><span style="color:#4EC9B0;">        Cipher</span><span style="color:#9CDCFE;"> cipher</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">Cipher</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">getInstance</span><span style="color:#D4D4D4;">(algorithm);</span></span>
<span class="line"><span style="color:#9CDCFE;">        cipher</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">init</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">Cipher</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">ENCRYPT_MODE</span><span style="color:#D4D4D4;">, publicKey);</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A9955;">        // Encode the plaintext to bytes</span></span>
<span class="line"><span style="color:#4EC9B0;">        byte</span><span style="color:#D4D4D4;">[] </span><span style="color:#9CDCFE;">plaintextBytes</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">plaintext</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">getBytes</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;UTF-8&quot;</span><span style="color:#D4D4D4;">);</span></span>
<span class="line"></span>
<span class="line"><span style="color:#6A9955;">        // Add OAEP padding to the plaintext bytes</span></span>
<span class="line"><span style="color:#4EC9B0;">        OAEPParameterSpec</span><span style="color:#9CDCFE;"> oaepParams</span><span style="color:#D4D4D4;"> = </span><span style="color:#C586C0;">new</span><span style="color:#DCDCAA;"> OAEPParameterSpec</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&quot;SHA-256&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#CE9178;">&quot;MGF1&quot;</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">MGF1ParameterSpec</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">SHA256</span><span style="color:#D4D4D4;">, </span><span style="color:#9CDCFE;">PSource</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">PSpecified</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">DEFAULT</span><span style="color:#D4D4D4;">);</span></span>
<span class="line"><span style="color:#9CDCFE;">        cipher</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">init</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">Cipher</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">ENCRYPT_MODE</span><span style="color:#D4D4D4;">, publicKey, oaepParams);</span></span>
<span class="line"><span style="color:#6A9955;">        // Encrypt the padded plaintext bytes</span></span>
<span class="line"><span style="color:#4EC9B0;">        byte</span><span style="color:#D4D4D4;">[] </span><span style="color:#9CDCFE;">encryptedBytes</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">cipher</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">doFinal</span><span style="color:#D4D4D4;">(plaintextBytes);</span></span>
<span class="line"><span style="color:#6A9955;">        // Convert the encrypted bytes to a Base64-encoded string</span></span>
<span class="line"><span style="color:#C586C0;">        return</span><span style="color:#C586C0;"> new</span><span style="color:#DCDCAA;"> BigInteger</span><span style="color:#D4D4D4;">(</span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">, encryptedBytes).</span><span style="color:#DCDCAA;">toString</span><span style="color:#D4D4D4;">(</span><span style="color:#B5CEA8;">16</span><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 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 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 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><div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-text"><span class="line"><span>f87666152da692735123f4e49053e5a98c16854673b2e632f31a3ff0c029640772873661a9a8412db6be447a0bfa03a295d15548cbfd2bb35634e98ba5f25b1205519d6e6119b483f4c516c1e106d45b04ff98c73560949d379d3edaf3c0ecd10a1d46134fb9ca443122ab33c16d1dd48280496f949ed960a2fbcd65f10935e</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div></div></div><h4 id="vercel云函数" tabindex="-1"><a class="header-anchor" href="#vercel云函数"><span>vercel云函数</span></a></h4><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-bash"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#569CD6;"> -G</span><span style="color:#CE9178;"> &#39;https://wasm-rsa.vercel.app/api/rsa&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &quot;t=$((\`</span><span style="color:#DCDCAA;">date</span><span style="color:#CE9178;"> &#39;+%s&#39;\`</span><span style="color:#D4D4D4;">*</span><span style="color:#CE9178;">1000+\`</span><span style="color:#DCDCAA;">date</span><span style="color:#CE9178;"> &#39;+%N&#39;\`</span><span style="color:#DCDCAA;">/1000000</span><span style="color:#CE9178;">))&quot;</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><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;timestamp&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;1684468084078&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    &quot;hash&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;a768efe5114ef8610f9ed9ebc28c00827375f4a3448ec4ab17958cacc4fde9898e5b7aa27f649426bba1acae4aa222aafaff7d528669b15249de0b2b60d86618557d8dc90684db4ec68e8d98e41d94f1c97d1d431c288e595ceb522d033822442a9e1ee150b32771a83fbf65c13329e9fda080fbe3bc85c49c1de7ab148d228f&quot;</span><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 class="line-number"></div><div class="line-number"></div></div></div><h2 id="获取refresh-csrf" tabindex="-1"><a class="header-anchor" href="#获取refresh-csrf"><span>获取refresh_csrf</span></a></h2><blockquote><p>https://www.bilibili.com/correspond/1/{correspondPath}</p></blockquote><p><em>请求方式：GET</em></p><p>鉴权方式：Cookie</p><p><strong>path 参数：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>correspondPath</td><td>str</td><td>使用当前毫秒时间戳生成的签名</td><td>必要</td><td>由 <a href="#%E7%94%9F%E6%88%90CorrespondPath%E7%AE%97%E6%B3%95">生成CorrespondPath算法</a> 加密获得</td></tr></tbody></table><p>将参数<code>correspondPath</code>拼接在 https://www.bilibili.com/correspond/1/ 后进行请求，例如</p><blockquote><p>https://www.bilibili.com/correspond/1/0248397e5139a8b878894cae46f8d6742ef7c728e46403706452b5dda90fe248e58e73bd6c2da0dba515c53af107dc1ecda757ce843579bcf197fcd7800586126e9b896b646cc94c23183a5a067642e96f7b6e803880e1d3cceabc9f1dc52a121b5e3ba5619e008f6b6dcb65a09d7864084ac114f4ec9ccf6218776fe4f2fa95</p></blockquote><p>请求该 url 会返回一个 html 页面，通常由 iframe 方式加载，它通过 SSR 方式返回一个实时刷新口令<code>refresh_csrf</code>存放于 html 标签中，并在 Client 端通过 js 请求 RestAPI 完成一些列的提交刷新、确认、SSO 站点登录等操作</p><p>若参数<code>correspondPath</code>错误或过期，则返回一个 404 Page</p><p>以下为返回的参数：</p><table><thead><tr><th>标签 id</th><th>内容</th><th>xpath</th><th>备注</th></tr></thead><tbody><tr><td>1-name</td><td>refresh_csrf</td><td>//div[id=&#39;1-name&#39;]/text()</td><td>实时刷新口令<br>用于更新 Cookie</td></tr></tbody></table><p><strong>示例：</strong></p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-bash"><span class="line"><span style="color:#9CDCFE;">correspondPath</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&#39;0248397e5139a8b878894cae46f8d6742ef7c728e46403706452b5dda90fe248e58e73bd6c2da0dba515c53af107dc1ecda757ce843579bcf197fcd7800586126e9b896b646cc94c23183a5a067642e96f7b6e803880e1d3cceabc9f1dc52a121b5e3ba5619e008f6b6dcb65a09d7864084ac114f4ec9ccf6218776fe4f2fa95&#39;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#569CD6;"> -G</span><span style="color:#CE9178;"> &quot;https://www.bilibili.com/correspond/1/</span><span style="color:#9CDCFE;">$correspondPath</span><span style="color:#CE9178;">&quot;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	-b</span><span style="color:#CE9178;"> &#39;SESSDATA=xxx&#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><div class="language-html line-numbers-mode" data-highlighter="shiki" data-ext="html" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-html"><span class="line"><span style="color:#808080;">&lt;!</span><span style="color:#569CD6;">DOCTYPE</span><span style="color:#9CDCFE;"> html</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">&lt;</span><span style="color:#569CD6;">html</span><span style="color:#9CDCFE;"> lang</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;zh-Hans&quot;</span><span style="color:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#808080;">&lt;</span><span style="color:#569CD6;">head</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">  &lt;</span><span style="color:#569CD6;">meta</span><span style="color:#9CDCFE;"> name</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;spm_prefix&quot;</span><span style="color:#9CDCFE;"> content</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;333.1193&quot;</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">  &lt;</span><span style="color:#569CD6;">link</span></span>
<span class="line"><span style="color:#9CDCFE;">    href</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;//s1.hdslb.com/bfs/static/jinkela/token-iframe/css/token-iframe.1.a035e81c3bee5fa1a05633ad534ad1f44b05e54d.css&quot;</span></span>
<span class="line"><span style="color:#9CDCFE;">    rel</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;stylesheet&quot;</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">&lt;/</span><span style="color:#569CD6;">head</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">&lt;</span><span style="color:#569CD6;">title</span><span style="color:#808080;">&gt;</span><span style="color:#D4D4D4;">Correspond</span><span style="color:#808080;">&lt;/</span><span style="color:#569CD6;">title</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">&lt;</span><span style="color:#569CD6;">script</span><span style="color:#9CDCFE;"> type</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;text/javascript&quot;</span></span>
<span class="line"><span style="color:#9CDCFE;">  src</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;//www.bilibili.com/gentleman/polyfill.js?features=Promise%2CObject.assign%2CString.prototype.includes%2CNumber.isNaN2%CglobalThis&quot;</span><span style="color:#808080;">&gt;&lt;/</span><span style="color:#569CD6;">script</span><span style="color:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#808080;">&lt;</span><span style="color:#569CD6;">body</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">  &lt;</span><span style="color:#569CD6;">div</span><span style="color:#9CDCFE;"> id</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;1-name&quot;</span><span style="color:#808080;">&gt;</span><span style="color:#D4D4D4;">b0cc8411ded2f9db2cff2edb3123acac</span><span style="color:#808080;">&lt;/</span><span style="color:#569CD6;">div</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">  &lt;</span><span style="color:#569CD6;">div</span><span style="color:#9CDCFE;"> id</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;token-iframe-app&quot;</span><span style="color:#808080;">&gt;&lt;/</span><span style="color:#569CD6;">div</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">  &lt;</span><span style="color:#569CD6;">script</span><span style="color:#9CDCFE;"> type</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;text/javascript&quot;</span></span>
<span class="line"><span style="color:#9CDCFE;">    src</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;//s1.hdslb.com/bfs/static/jinkela/token-iframe/2.token-iframe.a035e81c3bee5fa1a05633ad534ad1f44b05e54d.js&quot;</span><span style="color:#808080;">&gt;&lt;/</span><span style="color:#569CD6;">script</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">  &lt;</span><span style="color:#569CD6;">script</span><span style="color:#9CDCFE;"> type</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;text/javascript&quot;</span></span>
<span class="line"><span style="color:#9CDCFE;">    src</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;//s1.hdslb.com/bfs/static/jinkela/token-iframe/token-iframe.a035e81c3bee5fa1a05633ad534ad1f44b05e54d.js&quot;</span><span style="color:#808080;">&gt;&lt;/</span><span style="color:#569CD6;">script</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">&lt;/</span><span style="color:#569CD6;">body</span><span style="color:#808080;">&gt;</span></span>
<span class="line"><span style="color:#808080;">&lt;</span><span style="color:#569CD6;">script</span><span style="color:#9CDCFE;"> type</span><span style="color:#D4D4D4;">=</span><span style="color:#CE9178;">&quot;text/javascript&quot;</span><span style="color:#808080;">&gt;</span><span style="color:#9CDCFE;">window</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">reportMsgObj</span><span style="color:#D4D4D4;"> = {};</span></span>
<span class="line"><span style="color:#9CDCFE;">  window</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">reportConfig</span><span style="color:#D4D4D4;"> = {</span></span>
<span class="line"><span style="color:#9CDCFE;">    sample:</span><span style="color:#B5CEA8;"> 1</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    scrollTracker:</span><span style="color:#569CD6;"> true</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">    msgObjects:</span><span style="color:#CE9178;"> &#39;reportMsgObj&#39;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#D4D4D4;">  };</span></span>
<span class="line"></span>
<span class="line"><span style="color:#569CD6;">  let</span><span style="color:#9CDCFE;"> reportScript</span><span style="color:#D4D4D4;"> = </span><span style="color:#9CDCFE;">document</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">createElement</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&#39;script&#39;</span><span style="color:#D4D4D4;">);</span></span>
<span class="line"><span style="color:#9CDCFE;">  reportScript</span><span style="color:#D4D4D4;">.</span><span style="color:#9CDCFE;">src</span><span style="color:#D4D4D4;"> = </span><span style="color:#CE9178;">&#39;//s1.hdslb.com/bfs/seed/log/report/log-reporter.js&#39;</span><span style="color:#D4D4D4;">;</span></span>
<span class="line"><span style="color:#9CDCFE;">  document</span><span style="color:#D4D4D4;">.</span><span style="color:#DCDCAA;">getElementsByTagName</span><span style="color:#D4D4D4;">(</span><span style="color:#CE9178;">&#39;body&#39;</span><span style="color:#D4D4D4;">)[</span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">].</span><span style="color:#DCDCAA;">appendChild</span><span style="color:#D4D4D4;">(</span><span style="color:#9CDCFE;">reportScript</span><span style="color:#D4D4D4;">);</span><span style="color:#808080;">&lt;/</span><span style="color:#569CD6;">script</span><span style="color:#808080;">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#808080;">&lt;/</span><span style="color:#569CD6;">html</span><span style="color:#808080;">&gt;</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 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 class="line-number"></div></div></div><p>所以当前账号的实时刷新口令<code>refresh_csrf</code>为<code>b0cc8411ded2f9db2cff2edb3123acac</code></p><h2 id="刷新cookie" tabindex="-1"><a class="header-anchor" href="#刷新cookie"><span>刷新Cookie</span></a></h2><blockquote><p>https://passport.bilibili.com/x/passport-login/web/cookie/refresh</p></blockquote><p><em>请求方式：POST</em></p><p>鉴权方式：Cookie</p><p>刷新成功后会设置以下 Cookie 项：</p><p><code>sid</code>、<code>DedeUserID</code>、<code>DedeUserID__ckMd5</code>、<code>SESSDATA</code>、<code>bili_jct</code></p><p><strong>正文参数 (application/x-www-form-urlencoded)或 url 参数：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>csrf</td><td>str</td><td>CSRF Token</td><td>必要</td><td>位于 Cookie 中的<code>bili_jct</code>字段</td></tr><tr><td>refresh_csrf</td><td>str</td><td>实时刷新口令</td><td>必要</td><td>通过 <a href="#%E8%8E%B7%E5%8F%96refresh_csrf">获取refresh_csrf</a> 获得</td></tr><tr><td>source</td><td>str</td><td>访问来源？</td><td>必要</td><td>一般为<code>main_web</code></td></tr><tr><td>refresh_token</td><td>str</td><td>持久化刷新口令</td><td>必要</td><td>localStorage 中的<code>ac_time_value</code>字段，在登录成功后返回并保存</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：成功<br>-101：账号未登录<br>-111：csrf 校验失败<br>86095：refresh_csrf 错误或 refresh_token 与 cookie 不匹配</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为 0</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>status</td><td>num</td><td>0</td><td></td></tr><tr><td>message</td><td>str</td><td>空</td><td></td></tr><tr><td>refresh_token</td><td>str</td><td>新的持久化刷新口令</td><td>将存储于 localStorage 中的<code>ac_time_value</code>字段，以便下次使用</td></tr></tbody></table><p><strong>示例：</strong></p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-bash"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#569CD6;"> -i</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/x/passport-login/web/cookie/refresh&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &#39;csrf=f610640a37f51f6266f6b83cfc5eedbb&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &#39;refresh_csrf=b0cc8411ded2f9db2cff2edb3123acac&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &#39;source=main_web&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &#39;refresh_token=45240a041836905fe953e3b98b83d751&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	-b</span><span style="color:#CE9178;"> &#39;SESSDATA=xxx&#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 class="line-number"></div><div class="line-number"></div></div></div><details><summary>查看响应示例：</summary><p>http 响应（关键信息已做脱敏处理）：</p><div class="language-http line-numbers-mode" data-highlighter="shiki" data-ext="http" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-http"><span class="line"><span style="color:#D4D4D4;">HTTP/2 </span><span style="color:#B5CEA8;">200</span></span>
<span class="line"><span style="color:#569CD6;">date:</span><span style="color:#CE9178;"> Fri, 19 May 2023 07:34:11 GMT</span></span>
<span class="line"><span style="color:#569CD6;">content-type:</span><span style="color:#CE9178;"> application/json; charset=utf-8</span></span>
<span class="line"><span style="color:#569CD6;">content-length:</span><span style="color:#CE9178;"> 116</span></span>
<span class="line"><span style="color:#569CD6;">bili-status-code:</span><span style="color:#CE9178;"> 0</span></span>
<span class="line"><span style="color:#569CD6;">bili-trace-id:</span><span style="color:#CE9178;"> 17f4251365646726</span></span>
<span class="line"><span style="color:#569CD6;">set-cookie:</span><span style="color:#CE9178;"> SESSDATA=***; Path=/; Domain=bilibili.com; Expires=Wed, 15 Nov 2023 07:34:10 GMT; HttpOnly; Secure</span></span>
<span class="line"><span style="color:#569CD6;">set-cookie:</span><span style="color:#CE9178;"> bili_jct=***; Path=/; Domain=bilibili.com; Expires=Wed, 15 Nov 2023 07:34:10 GMT</span></span>
<span class="line"><span style="color:#569CD6;">set-cookie:</span><span style="color:#CE9178;"> DedeUserID=***; Path=/; Domain=bilibili.com; Expires=Wed, 15 Nov 2023 07:34:10 GMT</span></span>
<span class="line"><span style="color:#569CD6;">set-cookie:</span><span style="color:#CE9178;"> DedeUserID__ckMd5=***; Path=/; Domain=bilibili.com; Expires=Wed, 15 Nov 2023 07:34:10 GMT</span></span>
<span class="line"><span style="color:#569CD6;">set-cookie:</span><span style="color:#CE9178;"> sid=***; Path=/; Domain=bilibili.com; Expires=Wed, 15 Nov 2023 07:34:10 GMT</span></span>
<span class="line"><span style="color:#569CD6;">x-bili-trace-id:</span><span style="color:#CE9178;"> 3f6f6174aaa087b517f4251365646726</span></span>
<span class="line"><span style="color:#569CD6;">expires:</span><span style="color:#CE9178;"> Fri, 19 May 2023 07:34:10 GMT</span></span>
<span class="line"><span style="color:#569CD6;">cache-control:</span><span style="color:#CE9178;"> no-cache</span></span>
<span class="line"><span style="color:#569CD6;">x-cache-webcdn:</span><span style="color:#CE9178;"> BYPASS from blzone03</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D4D4D4;">{</span><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 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 style="color:#9CDCFE;">&quot;ttl&quot;</span><span style="color:#D4D4D4;">:</span><span style="color:#B5CEA8;">1</span><span style="color:#D4D4D4;">,</span><span style="color:#9CDCFE;">&quot;data&quot;</span><span style="color:#D4D4D4;">:{</span><span style="color:#9CDCFE;">&quot;status&quot;</span><span style="color:#D4D4D4;">:</span><span style="color:#B5CEA8;">0</span><span style="color:#D4D4D4;">,</span><span style="color:#9CDCFE;">&quot;message&quot;</span><span style="color:#D4D4D4;">:</span><span style="color:#CE9178;">&quot;&quot;</span><span style="color:#D4D4D4;">,</span><span style="color:#9CDCFE;">&quot;refresh_token&quot;</span><span style="color:#D4D4D4;">:</span><span style="color:#CE9178;">&quot;ae1bd1149b56af9743ffe7bbbeff3e51&quot;</span><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 class="line-number"></div></div></div><p>JSON Payload：</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 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;status&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;&quot;</span><span style="color:#D4D4D4;">,</span></span>
<span class="line"><span style="color:#9CDCFE;">        &quot;refresh_token&quot;</span><span style="color:#D4D4D4;">: </span><span style="color:#CE9178;">&quot;ae1bd1149b56af9743ffe7bbbeff3e51&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 class="line-number"></div><div class="line-number"></div></div></div></details><h2 id="确认更新" tabindex="-1"><a class="header-anchor" href="#确认更新"><span>确认更新</span></a></h2><blockquote><p>https://passport.bilibili.com/x/passport-login/web/confirm/refresh</p></blockquote><p><em>请求方式：POST</em></p><p>鉴权方式：Cookie</p><p>该步操作将让旧的<code>refresh_token</code>对应的 Cookie 失效</p><p><strong>正文参数 (application/x-www-form-urlencoded)或 url 参数：</strong></p><table><thead><tr><th>参数名</th><th>类型</th><th>内容</th><th>必要性</th><th>备注</th></tr></thead><tbody><tr><td>csrf</td><td>str</td><td>CSRF Token（位于 cookie）</td><td>必要</td><td>从新的 cookie 中获取，位于 Cookie 中的<code>bili_jct</code>字段</td></tr><tr><td>refresh_token</td><td>str</td><td>旧的持久化刷新口令</td><td>必要</td><td>在刷新前 localStorage 中的<code>ac_time_value</code>获取，<strong>并非刷新后返回的值</strong></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：成功<br>-101：账号未登录<br>-111：csrf 校验失败<br>-400：请求错误</td></tr><tr><td>message</td><td>str</td><td>错误信息</td><td>默认为 0</td></tr><tr><td>ttl</td><td>num</td><td>1</td><td></td></tr></tbody></table><p><strong>示例：</strong></p><div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="background-color:#1E1E1E;color:#D4D4D4;"><pre class="shiki dark-plus vp-code"><code class="language-bash"><span class="line"><span style="color:#DCDCAA;">curl</span><span style="color:#CE9178;"> &#39;https://passport.bilibili.com/x/passport-login/web/confirm/refresh&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &#39;csrf=1e9658858e6da76be64bd92cdc0fa324&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	--data-urlencode</span><span style="color:#CE9178;"> &#39;refresh_token=45240a041836905fe953e3b98b83d751&#39;</span><span style="color:#D7BA7D;"> \\</span></span>
<span class="line"><span style="color:#569CD6;">	-b</span><span style="color:#CE9178;"> &#39;SESSDATA=xxx&#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;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>
<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></div></details>`,96)]))}const r=n(o,[["render",p]]),i=JSON.parse('{"path":"/docs/login/cookie_refresh.html","title":"Web端Cookie刷新","lang":"zh-CN","frontmatter":{},"git":{"updatedTime":1726759053000,"contributors":[{"name":"SocialSisterYi","username":"SocialSisterYi","email":"1440239038@qq.com","commits":3,"url":"https://github.com/SocialSisterYi"},{"name":"whiter","username":"whiter","email":"whiterasbk@qq.com","commits":1,"url":"https://github.com/whiter"},{"name":"cqrect","username":"cqrect","email":"136703144+cqrect@users.noreply.github.com","commits":1,"url":"https://github.com/cqrect"},{"name":"lb-chc","username":"lb-chc","email":"69136546+lb-chc@users.noreply.github.com","commits":2,"url":"https://github.com/lb-chc"},{"name":"DannyDu26","username":"DannyDu26","email":"50359598+DannyDu26@users.noreply.github.com","commits":1,"url":"https://github.com/DannyDu26"},{"name":"Duyulin","username":"Duyulin","email":"duyulin@kingsoft.com","commits":1,"url":"https://github.com/Duyulin"},{"name":"SessionHu","username":"SessionHu","email":"102411014+SessionHu@users.noreply.github.com","commits":1,"url":"https://github.com/SessionHu"}],"changelog":[{"hash":"1e24c6b1889160c4c35c01416aa4239501accf5f","time":1726759053000,"email":"102411014+SessionHu@users.noreply.github.com","author":"Session小胡","message":"调整部分接口描述与错误修复 (#1088)","coAuthors":[{"name":"社会易姐QwQ","email":"45892418+SocialSisterYi@users.noreply.github.com"}]},{"hash":"e6dc29ec338003ce0e9d8fb2ef1c6b205ebc0556","time":1716012631000,"email":"50359598+DannyDu26@users.noreply.github.com","author":"Danny Du","message":"feat: cookie刷新生成CorrespondPath算法添加java代码实现 (#1017)","coAuthors":[{"name":"Duyulin","email":"duyulin@kingsoft.com"}]},{"hash":"e6f1e7829d3eebb5011f4d6a1e798e9db7e135ef","time":1705727483000,"email":"69136546+lb-chc@users.noreply.github.com","author":"lb-chc","message":"csrf token 就是 bili_jct (#939)"},{"hash":"ad246446b099aec92db86c2b0a3ea06df329d439","time":1704754997000,"email":"69136546+lb-chc@users.noreply.github.com","author":"lb-chc","message":"使说明更易懂 (#930)"},{"hash":"2dad8999a1c33e374d36133ed2fbb02515bc018e","time":1700194660000,"email":"136703144+cqrect@users.noreply.github.com","author":"cqrect","message":"添加了生成CorrespondPath算法的Go实现 (#860)"},{"hash":"09fe412ec7ce547fbcc5c70833b36170904ad535","time":1692145066000,"email":"whiterasbk@qq.com","author":"whiter","message":"添加了生成CorrespondPath算法的kotlin实现 (#786)"},{"hash":"cefb7e7c403b2a2ee24ac55d628e3dc67c97a2a6","time":1684511359000,"email":"1440239038@qq.com","author":"SocialSisterYi","message":"fix typo"},{"hash":"a46f140fde73530868ce9db5f613deed8d5c645e","time":1684483688000,"email":"1440239038@qq.com","author":"SocialSisterYi","message":"add【web端Cookie刷新】APIDoc"}]},"filePathRelative":"docs/login/cookie_refresh.md"}');export{r as comp,i as data};
