mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-11 14:56:57 +08:00
feat: exchange api security handle
This commit is contained in:
@@ -12,6 +12,11 @@ export class CryptoService {
|
||||
private static publicKeyPEM: string | null = null;
|
||||
|
||||
static async initialize(publicKeyPEM: string) {
|
||||
// 检查 Web Crypto API 是否可用
|
||||
if (!window.crypto || !window.crypto.subtle) {
|
||||
throw new Error('Web Crypto API is not available. Please use HTTPS or localhost to access the application.');
|
||||
}
|
||||
|
||||
if (this.publicKey && this.publicKeyPEM === publicKeyPEM) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user