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,