interface KVNamespace { put: (key: string, value: string, options?: { expiration?: number, expirationTtl?: number, metadata?: object }) => Promise; get: (key: string) => Promise; delete: (key: string) => Promise; } interface Env { SEND_PASSWORD:string; API_TOKEN: string; // API 访问令牌 JWT_SECRET: string; // JWT 密钥 USER_NAME: string; // 用户名 PASSWORD: string; // 密码 KV: KVNamespace; ASSETS:any; } /** * 登录凭证接口 */ interface LoginCredentials { /** 用户名 */ username: string; /** 密码 */ password: string; } interface RouteContext { request: Request; functionPath: string; waitUntil: (promise: Promise) => void; passThroughOnException: () => void; next: (input?: Request | string, init?: RequestInit) => Promise; env: Env; params: any; data: any; }