d1/sqlite支持

This commit is contained in:
mtvpls
2026-01-30 14:27:43 +08:00
parent c4198e0954
commit c86f9cdca7
11 changed files with 2110 additions and 11 deletions
+5 -7
View File
@@ -1,5 +1,10 @@
/* eslint-disable no-console */
import { TOKEN_CONFIG } from './token-config';
// Re-export TOKEN_CONFIG for backward compatibility
export { TOKEN_CONFIG };
// Lazy import to avoid Edge Runtime issues in middleware
let getStorage: (() => any) | null = null;
@@ -11,13 +16,6 @@ async function loadStorage() {
return getStorage();
}
// Token 配置
export const TOKEN_CONFIG = {
ACCESS_TOKEN_AGE: 4 * 60 * 60 * 1000, // 4 小时
REFRESH_TOKEN_AGE: 60 * 24 * 60 * 60 * 1000, // 60 天
RENEWAL_THRESHOLD: 10 * 60 * 1000, // 剩余 10 分钟时自动续期
};
interface TokenData {
token: string;
deviceInfo: string;