重构绘图相关

This commit is contained in:
sijinhui
2024-02-22 00:21:36 +08:00
parent 7c3c19e965
commit 747bed9826
11 changed files with 116 additions and 648 deletions

View File

@@ -1,6 +1,7 @@
import { NextRequest, NextResponse } from "next/server";
import { auth } from "@/app/api/auth";
import { auth, getIP } from "@/app/api/auth";
import { ModelProvider } from "@/app/constant";
import { requestLog } from "@/app/api/common";
const BASE_URL = process.env.MIDJOURNEY_PROXY_URL ?? null;
const MIDJOURNEY_PROXY_KEY = process.env.MIDJOURNEY_PROXY_KEY ?? null;
@@ -53,6 +54,10 @@ async function handle(
"",
);
if (reqPath.startsWith("mj/submit/")) {
await requestLog(req, jsonBody, reqPath);
}
let fetchUrl = `${mjProxyUrl}/${reqPath}`;
console.log("[MJ Proxy] ", fetchUrl);