From 42b2ead421468ef3eac780a3f8ed078268757d51 Mon Sep 17 00:00:00 2001 From: hfshfg <38004547@qq.com> Date: Mon, 6 Apr 2026 16:55:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20cloud.html=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AF=BB=E5=8F=96URL=20=3Fkey=3D=E5=8F=82=E6=95=B0=E5=B9=B6?= =?UTF-8?q?=E5=A1=AB=E5=85=A5=E5=85=85=E5=80=BC=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- website/cloud.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/website/cloud.html b/website/cloud.html index b7a6378..bb8d607 100644 --- a/website/cloud.html +++ b/website/cloud.html @@ -955,6 +955,23 @@ document.getElementById('keyInput').addEventListener('input', function() { document.getElementById('balanceLine').textContent = '粘贴 Key 后自动查询余额'; } }); + +// URL 参数自动填入 Key(从 U 盘 switch.html 跳转过来时携带) +(function() { + const params = new URLSearchParams(window.location.search); + const key = params.get('key') || params.get('api_key') || ''; + if (key && key.startsWith('sk-')) { + const inp = document.getElementById('keyInput'); + inp.value = key; + updateHint(key); + if (validateKey(key)) queryBalance(key); + // 滚动到充值区 + setTimeout(() => { + const el = document.getElementById('recharge'); + if (el) el.scrollIntoView({behavior: 'smooth', block: 'start'}); + }, 300); + } +})();