From b241881c74ca54e8837c39244418f53d7e6b82aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E7=91=BE?= <74231782+sj817@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:50:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7ID?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2=E9=94=99=E8=AF=AF=E5=B9=B6?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../napcat-webui-backend/src/helper/PasskeyHelper.ts | 11 ++++++----- .../src/components/display_card/container.tsx | 7 ------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/napcat-webui-backend/src/helper/PasskeyHelper.ts b/packages/napcat-webui-backend/src/helper/PasskeyHelper.ts index cdf4660c..36223ade 100644 --- a/packages/napcat-webui-backend/src/helper/PasskeyHelper.ts +++ b/packages/napcat-webui-backend/src/helper/PasskeyHelper.ts @@ -37,7 +37,7 @@ export class PasskeyHelper { } catch { await fs.writeFile(passkeyFile, JSON.stringify({}, null, 2)); } - } catch (error) { + } catch (_error) { // Directory or file already exists or other error } } @@ -49,7 +49,8 @@ export class PasskeyHelper { const data = await fs.readFile(passkeyFile, 'utf-8'); const passkeys = JSON.parse(data); return typeof passkeys === 'object' && passkeys !== null ? passkeys : {}; - } catch (error) { + } catch (_error) { + console.error('Failed to read passkey file:', _error); return {}; } } @@ -82,8 +83,8 @@ export class PasskeyHelper { const options = await generateRegistrationOptions({ rpName: RP_NAME, rpID: rpId, - userID: new TextEncoder().encode(userId), - userName: userName, + userID: new TextEncoder().encode(userId) as Uint8Array, + userName, attestationType: 'none', excludeCredentials: userPasskeys.map(passkey => ({ id: passkey.id, @@ -203,4 +204,4 @@ export class PasskeyHelper { const userPasskeys = await this.getUserPasskeys(userId); return userPasskeys.length > 0; } -} \ No newline at end of file +} diff --git a/packages/napcat-webui-frontend/src/components/display_card/container.tsx b/packages/napcat-webui-frontend/src/components/display_card/container.tsx index e3a1fd0d..790d09b9 100644 --- a/packages/napcat-webui-frontend/src/components/display_card/container.tsx +++ b/packages/napcat-webui-frontend/src/components/display_card/container.tsx @@ -3,7 +3,6 @@ import { useLocalStorage } from '@uidotdev/usehooks'; import clsx from 'clsx'; import key from '@/const/key'; - export interface ContainerProps { title: string; tag?: React.ReactNode; @@ -24,7 +23,6 @@ export interface DisplayCardProps { const DisplayCardContainer: React.FC = ({ title: _title, action, - tag, enableSwitch, children, className, @@ -40,11 +38,6 @@ const DisplayCardContainer: React.FC = ({ )} > - {tag && ( -
- {tag} -
- )}