This commit is contained in:
xuzhenjun 2023-04-11 01:19:32 +08:00
parent 8ec37bc7f1
commit 8c4669af3b
3 changed files with 4 additions and 2 deletions

View File

@ -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: {

View File

@ -3,7 +3,8 @@ import { isMobileScreen } from "../utils";
const cn = {
WIP: "该功能仍在开发中……",
Error: {
Unauthorized: "现在是未授权状态,请在设置页输入访问密码。",
Unauthorized:
"现在是未授权状态,\n 关注微信公众号【coder思维】回复关键词`ai` \n 获取授权链接",
},
ChatItem: {
ChatItemCount: (count: number) => `${count} 条对话`,

View File

@ -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,