diff --git a/src/index.ts b/src/index.ts index 0c7e187..99e6e60 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,6 +54,10 @@ export default { async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise { const url = new URL(request.url); + if (url.pathname === '/') { + return Response.redirect('https://searchgal.homes', 302); + } + if (request.method === "OPTIONS") { return new Response(null, { headers: corsHeaders }); } diff --git a/src/utils/httpClient.ts b/src/utils/httpClient.ts index 7a5c81e..4fcf320 100644 --- a/src/utils/httpClient.ts +++ b/src/utils/httpClient.ts @@ -44,6 +44,8 @@ export async function fetchClient( * @param data 要记录的数据对象。 */ export async function logToCF(data: object) { + // 在此处添加 console.log,以便在 Cloudflare 控制台也能看到日志 + console.log(JSON.stringify(data)); try { await fetch("https://log.gal.homes", { method: "POST",