feat: 原料库

This commit is contained in:
rd
2025-08-23 16:14:05 +08:00
parent 23becf5884
commit 4029ec0f7e
11 changed files with 647 additions and 6 deletions

View File

@ -115,7 +115,7 @@ export function formatFileSize(bytes: number): string {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
const sizes = ['Bytes', 'kb', 'mB', 'gB', 'tB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];