feat:移除了弹窗,服务器添加sls

This commit is contained in:
2026-09-08 22:39:45 +08:00
commit 6a295f9a7a
4082 changed files with 1322534 additions and 0 deletions

View File

@ -0,0 +1,35 @@
export function formatNumber(value: number): string {
return new Intl.NumberFormat('zh-CN').format(value)
}
export function formatUtcDay(value: string): string {
const parsed = new Date(`${value}T00:00:00.000Z`)
return Number.isNaN(parsed.getTime())
? value
: new Intl.DateTimeFormat('zh-CN', {
month: 'numeric',
day: 'numeric',
timeZone: 'UTC',
}).format(parsed)
}
export function formatUtcTimestamp(value: string): string {
const parsed = new Date(value)
return Number.isNaN(parsed.getTime())
? value
: `${new Intl.DateTimeFormat('zh-CN', {
month: '2-digit',
day: 'numeric',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
hour12: false,
timeZone: 'UTC',
}).format(parsed)}UTC`
}
export function statusCode(error: unknown): number | null {
if (!error || typeof error !== 'object') return null
const value = error as { statusCode?: number; status?: number }
return value.statusCode ?? value.status ?? null
}