mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 20:53:45 +08:00
修改: app/components/settings.tsx
修改: app/components/ui-lib.tsx 修改: app/constant.ts 修改: app/utils/encryption.ts
This commit is contained in:
@@ -8,6 +8,7 @@ if (!SECRET_KEY || SECRET_KEY.length < 32) {
|
||||
"ENCRYPTION_KEY environment variable must be set with at least 32 characters",
|
||||
);
|
||||
}
|
||||
|
||||
export function encrypt(data: string): string {
|
||||
try {
|
||||
return AES.encrypt(data, SECRET_KEY).toString();
|
||||
@@ -26,3 +27,9 @@ export function decrypt(encryptedData: string): string {
|
||||
return encryptedData; // Fallback to the original data if decryption fails
|
||||
}
|
||||
}
|
||||
|
||||
export function maskSensitiveValue(value: string): string {
|
||||
if (!value) return "";
|
||||
if (value.length <= 4) return value;
|
||||
return "*".repeat(value.length - 4) + value.slice(-4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user