diff --git a/src/pages/AuthFilesPage.module.scss b/src/pages/AuthFilesPage.module.scss
index fc8807f..6f09678 100644
--- a/src/pages/AuthFilesPage.module.scss
+++ b/src/pages/AuthFilesPage.module.scss
@@ -417,8 +417,6 @@
display: flex;
flex-direction: column;
gap: $spacing-sm;
- max-height: 400px;
- overflow-y: auto;
}
.modelItem {
diff --git a/src/pages/LogsPage.tsx b/src/pages/LogsPage.tsx
index eab0cc5..e044fd1 100644
--- a/src/pages/LogsPage.tsx
+++ b/src/pages/LogsPage.tsx
@@ -7,6 +7,7 @@ import { ToggleSwitch } from '@/components/ui/ToggleSwitch';
import { IconDownload, IconRefreshCw, IconTimer, IconTrash2 } from '@/components/ui/icons';
import { useNotificationStore, useAuthStore } from '@/stores';
import { logsApi } from '@/services/api/logs';
+import { formatUnixTimestamp } from '@/utils/format';
import styles from './LogsPage.module.scss';
interface ErrorLogItem {
@@ -629,7 +630,7 @@ export function LogsPage() {
{item.name}
{item.size ? `${(item.size / 1024).toFixed(1)} KB` : ''}{' '}
- {item.modified ? new Date(item.modified).toLocaleString() : ''}
+ {item.modified ? formatUnixTimestamp(item.modified) : ''}
diff --git a/src/utils/format.ts b/src/utils/format.ts
index 153a31e..109a9e6 100644
--- a/src/utils/format.ts
+++ b/src/utils/format.ts
@@ -52,6 +52,37 @@ export function formatDateTime(date: string | Date): string {
});
}
+/**
+ * 将 Unix 时间戳(秒/毫秒/微秒/纳秒)格式化为本地时间字符串
+ */
+export function formatUnixTimestamp(value: unknown, locale?: string): string {
+ if (value === null || value === undefined || value === '') return '';
+
+ const asNumber = typeof value === 'number' ? value : Number(value);
+ const date = (() => {
+ if (!Number.isFinite(asNumber) || Number.isNaN(asNumber)) {
+ return new Date(String(value));
+ }
+
+ const abs = Math.abs(asNumber);
+
+ // 秒:常见 10 位(~1e9)
+ if (abs < 1e11) return new Date(asNumber * 1000);
+
+ // 毫秒:常见 13 位(~1e12)
+ if (abs < 1e14) return new Date(asNumber);
+
+ // 微秒:常见 16 位(~1e15)
+ if (abs < 1e17) return new Date(Math.round(asNumber / 1000));
+
+ // 纳秒:常见 19 位(~1e18)
+ return new Date(Math.round(asNumber / 1e6));
+ })();
+
+ if (Number.isNaN(date.getTime())) return '';
+ return locale ? date.toLocaleString(locale) : date.toLocaleString();
+}
+
/**
* 格式化数字(添加千位分隔符)
*/