修改密钥加密逻辑

This commit is contained in:
glay
2024-11-23 13:52:14 +08:00
parent a85db21e1f
commit ff88421904
5 changed files with 50 additions and 44 deletions

View File

@@ -17,7 +17,7 @@ export function encrypt(data: string): string {
return AES.encrypt(data, SECRET_KEY).toString();
} catch (error) {
console.error("Encryption failed:", error);
return data;
return "";
}
}
@@ -31,7 +31,8 @@ export function decrypt(encryptedData: string): string {
}
return decrypted;
} catch (error) {
return encryptedData;
console.error("Decryption failed:", error);
return "";
}
}