From 8c4669af3b63a91adb87f3df3cfdc691f789e60b Mon Sep 17 00:00:00 2001 From: xuzhenjun <412530435@qq.com> Date: Tue, 11 Apr 2023 01:19:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=89=B4=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/common.ts | 1 + app/locales/cn.ts | 3 ++- middleware.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/common.ts b/app/api/common.ts index 842eeacaf..abee6fd71 100644 --- a/app/api/common.ts +++ b/app/api/common.ts @@ -10,6 +10,7 @@ export async function requestOpenai(req: NextRequest) { const openaiPath = req.headers.get("path"); console.log("[Proxy] ", openaiPath); + console.log("[apiKey] ", apiKey); return fetch(`${PROTOCOL}://${BASE_URL}/${openaiPath}`, { headers: { diff --git a/app/locales/cn.ts b/app/locales/cn.ts index 49cd407e1..ecdfe4fe8 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -3,7 +3,8 @@ import { isMobileScreen } from "../utils"; const cn = { WIP: "该功能仍在开发中……", Error: { - Unauthorized: "现在是未授权状态,请在设置页输入访问密码。", + Unauthorized: + "现在是未授权状态,\n 关注微信公众号【coder思维】回复关键词:`ai` \n 获取授权链接", }, ChatItem: { ChatItemCount: (count: number) => `${count} 条对话`, diff --git a/middleware.ts b/middleware.ts index 9338a2c6b..e4ddb73f0 100644 --- a/middleware.ts +++ b/middleware.ts @@ -15,7 +15,7 @@ export function middleware(req: NextRequest) { console.log("[Auth] got access code:", accessCode); console.log("[Auth] hashed access code:", hashedCode); - if (ACCESS_CODES.size > 0 && !ACCESS_CODES.has(hashedCode) && !token) { + if (!accessCode) { return NextResponse.json( { error: true,