feat: prepare Zhinian desktop client for pilot release

This commit is contained in:
inman
2026-04-29 10:23:20 +08:00
parent f9361e686a
commit 47b83b79fc
149 changed files with 15341 additions and 3590 deletions

View File

@@ -28,7 +28,9 @@ export interface DeviceAuthPayloadParams {
signedAtMs: number;
token?: string | null;
nonce?: string | null;
version?: 'v1' | 'v2';
version?: 'v1' | 'v2' | 'v3';
platform?: string | null;
deviceFamily?: string | null;
}
const ED25519_SPKI_PREFIX = Buffer.from('302a300506032b6570032100', 'hex');
@@ -143,5 +145,10 @@ export function buildDeviceAuthPayload(params: DeviceAuthPayloadParams): string
token,
];
if (version === 'v2') base.push(params.nonce ?? '');
if (version === 'v3') {
base.push(params.nonce ?? '');
base.push(params.platform?.trim() ?? '');
base.push(params.deviceFamily?.trim() ?? '');
}
return base.join('|');
}