refactor: optimize random byte generation for recovery and JWT secret functions

This commit is contained in:
shuaiplus
2026-03-12 01:59:28 +08:00
parent 3eb517a92f
commit 0bb1baf768
5 changed files with 25 additions and 22 deletions
-6
View File
@@ -138,12 +138,6 @@ function parseFieldType(value: number | string | null | undefined): CustomFieldT
return 0;
}
function fieldTypeLabel(type: CustomFieldType): string {
if (type === 3) return t('txt_linked');
const found = FIELD_TYPE_OPTIONS.find((x) => x.value === type);
return found ? found.label : t('txt_text');
}
function toBooleanFieldValue(raw: string): boolean {
const v = String(raw || '').trim().toLowerCase();
return v === '1' || v === 'true' || v === 'yes' || v === 'on';