feat: add d1 support (untested)

This commit is contained in:
shinya
2025-07-13 18:57:06 +08:00
parent e91d00ec6d
commit e27fdb75c9
5 changed files with 563 additions and 6 deletions

View File

@@ -8,8 +8,11 @@ export const runtime = 'edge';
// 读取存储类型环境变量,默认 localstorage
const STORAGE_TYPE =
(process.env.NEXT_PUBLIC_STORAGE_TYPE as string | undefined) ||
'localstorage';
(process.env.NEXT_PUBLIC_STORAGE_TYPE as
| 'localstorage'
| 'redis'
| 'd1'
| undefined) || 'localstorage';
// 生成签名
async function generateSignature(

View File

@@ -8,8 +8,11 @@ export const runtime = 'edge';
// 读取存储类型环境变量,默认 localstorage
const STORAGE_TYPE =
(process.env.NEXT_PUBLIC_STORAGE_TYPE as string | undefined) ||
'localstorage';
(process.env.NEXT_PUBLIC_STORAGE_TYPE as
| 'localstorage'
| 'redis'
| 'd1'
| undefined) || 'localstorage';
// 生成签名
async function generateSignature(