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,26 @@
import { createRequire } from 'node:module'
import type { PlatformProxy } from 'wrangler'
import type { DashboardBindings } from '../utils/bindings'
let proxy: PlatformProxy<DashboardBindings> | null = null
const require = createRequire(import.meta.url)
export default defineNitroPlugin(async (nitroApp) => {
const { getPlatformProxy } = require('wrangler') as typeof import('wrangler')
proxy = await getPlatformProxy<DashboardBindings>({
configPath: 'wrangler.toml',
persist: false,
remoteBindings: true,
})
nitroApp.hooks.hook('request', (event) => {
event.context.cloudflare = { env: proxy?.env ?? {} }
})
nitroApp.hooks.hook('close', async () => {
await proxy?.dispose()
proxy = null
})
})