feat: init

This commit is contained in:
ccbikai
2024-05-25 08:09:30 +08:00
commit bd47e755d5
298 changed files with 21915 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import type { H3Event } from 'h3'
export function getExpiration(event: H3Event, expiration: number | undefined) {
const { previewMode } = useRuntimeConfig(event).public
if (previewMode) {
const { previewTTL } = useAppConfig(event)
const previewExpiration = Math.floor(Date.now() / 1000) + previewTTL
if (!expiration || expiration > previewExpiration)
expiration = Math.floor(Date.now() / 1000) + previewTTL
}
return expiration
}