From 8debb785fb2a53c364b038d29b692dc789ab6698 Mon Sep 17 00:00:00 2001 From: sijinhui Date: Sat, 30 Mar 2024 22:49:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AC=A1=E4=BC=98=E5=8C=96=E8=AE=A4?= =?UTF-8?q?=E8=AF=81-=E6=9F=A5=E8=AF=A2=E5=B7=B2=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=97=B6=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/common.ts | 8 +------- app/api/logs/[...path]/route.ts | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/api/common.ts b/app/api/common.ts index ad994190c..bbc3fd6bf 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -159,12 +159,6 @@ export async function requestLog( } const baseUrl = "http://localhost:3000"; const ip = getIP(req); - // 对其进行 Base64 解码 - // let h_userName = req.headers.get("x-request-name"); - // if (h_userName) { - // const buffer = Buffer.from(h_userName, "base64"); - // h_userName = decodeURIComponent(buffer.toString("utf-8")); - // } let h_userName = await getSessionName(); console.log("[中文]", h_userName, baseUrl); const logData = { @@ -172,7 +166,7 @@ export async function requestLog( path: url_path, logEntry: JSON.stringify(jsonBody), model: url_path.startsWith("mj/") ? "midjourney" : jsonBody?.model, // 后面尝试请求是添加到参数 - userName: h_userName, + name: h_userName, }; await fetch(`${baseUrl}/api/logs/openai`, { diff --git a/app/api/logs/[...path]/route.ts b/app/api/logs/[...path]/route.ts index 8a1839622..43182faa9 100644 --- a/app/api/logs/[...path]/route.ts +++ b/app/api/logs/[...path]/route.ts @@ -10,7 +10,7 @@ async function handle( try { const request_data = await req.json(); if (request_data?.userName) { - await insertUser({ name: request_data?.userName }); + await insertUser({ name: request_data?.name, email: request_data?.name }); } // console.log("===========4", request_data); try {