mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-17 13:50:36 +00:00
fix: 修复用户ID类型转换错误并移除不必要的标签渲染
This commit is contained in:
parent
aecf33f4dc
commit
b241881c74
@ -37,7 +37,7 @@ export class PasskeyHelper {
|
|||||||
} catch {
|
} catch {
|
||||||
await fs.writeFile(passkeyFile, JSON.stringify({}, null, 2));
|
await fs.writeFile(passkeyFile, JSON.stringify({}, null, 2));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
// Directory or file already exists or other 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 data = await fs.readFile(passkeyFile, 'utf-8');
|
||||||
const passkeys = JSON.parse(data);
|
const passkeys = JSON.parse(data);
|
||||||
return typeof passkeys === 'object' && passkeys !== null ? passkeys : {};
|
return typeof passkeys === 'object' && passkeys !== null ? passkeys : {};
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
|
console.error('Failed to read passkey file:', _error);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,8 +83,8 @@ export class PasskeyHelper {
|
|||||||
const options = await generateRegistrationOptions({
|
const options = await generateRegistrationOptions({
|
||||||
rpName: RP_NAME,
|
rpName: RP_NAME,
|
||||||
rpID: rpId,
|
rpID: rpId,
|
||||||
userID: new TextEncoder().encode(userId),
|
userID: new TextEncoder().encode(userId) as Uint8Array<ArrayBuffer>,
|
||||||
userName: userName,
|
userName,
|
||||||
attestationType: 'none',
|
attestationType: 'none',
|
||||||
excludeCredentials: userPasskeys.map(passkey => ({
|
excludeCredentials: userPasskeys.map(passkey => ({
|
||||||
id: passkey.id,
|
id: passkey.id,
|
||||||
@ -203,4 +204,4 @@ export class PasskeyHelper {
|
|||||||
const userPasskeys = await this.getUserPasskeys(userId);
|
const userPasskeys = await this.getUserPasskeys(userId);
|
||||||
return userPasskeys.length > 0;
|
return userPasskeys.length > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { useLocalStorage } from '@uidotdev/usehooks';
|
|||||||
import clsx from 'clsx';
|
import clsx from 'clsx';
|
||||||
import key from '@/const/key';
|
import key from '@/const/key';
|
||||||
|
|
||||||
|
|
||||||
export interface ContainerProps {
|
export interface ContainerProps {
|
||||||
title: string;
|
title: string;
|
||||||
tag?: React.ReactNode;
|
tag?: React.ReactNode;
|
||||||
@ -24,7 +23,6 @@ export interface DisplayCardProps {
|
|||||||
const DisplayCardContainer: React.FC<ContainerProps> = ({
|
const DisplayCardContainer: React.FC<ContainerProps> = ({
|
||||||
title: _title,
|
title: _title,
|
||||||
action,
|
action,
|
||||||
tag,
|
|
||||||
enableSwitch,
|
enableSwitch,
|
||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
@ -40,11 +38,6 @@ const DisplayCardContainer: React.FC<ContainerProps> = ({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<CardHeader className='p-4 pb-2 flex items-center justify-between gap-3'>
|
<CardHeader className='p-4 pb-2 flex items-center justify-between gap-3'>
|
||||||
{tag && (
|
|
||||||
<div className='text-center text-default-500 font-medium mb-1 absolute top-0 left-1/2 -translate-x-1/2 text-xs pointer-events-none bg-default-200/50 dark:bg-default-100/50 backdrop-blur-sm px-3 py-0.5 rounded-b-lg shadow-sm z-10'>
|
|
||||||
{tag}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className='flex-1 min-w-0 mr-2'>
|
<div className='flex-1 min-w-0 mr-2'>
|
||||||
<div className='inline-flex items-center px-3 py-1 rounded-lg bg-default-100/50 dark:bg-white/10 border border-transparent dark:border-white/5'>
|
<div className='inline-flex items-center px-3 py-1 rounded-lg bg-default-100/50 dark:bg-white/10 border border-transparent dark:border-white/5'>
|
||||||
<span className='font-bold text-default-600 dark:text-white/90 text-sm truncate select-text'>
|
<span className='font-bold text-default-600 dark:text-white/90 text-sm truncate select-text'>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user