mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-03 00:26:40 +08:00
commit
6c6453644e
@ -88,13 +88,13 @@ export function auth(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (systemApiKey) {
|
if (systemApiKey) {
|
||||||
console.log("[Auth] use system api key");
|
// console.log("[Auth] use system api key");
|
||||||
req.headers.set("Authorization", `Bearer ${systemApiKey}`);
|
req.headers.set("Authorization", `Bearer ${systemApiKey}`);
|
||||||
} else {
|
} else {
|
||||||
console.log("[Auth] admin did not provide an api key");
|
// console.log("[Auth] admin did not provide an api key");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("[Auth] use user api key");
|
// console.log("[Auth] use user api key");
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -117,7 +117,7 @@ export async function requestOpenai(
|
|||||||
// If openaiOrganizationHeader is present, log it; otherwise, log that the header is not present
|
// If openaiOrganizationHeader is present, log it; otherwise, log that the header is not present
|
||||||
console.log("[Org ID]", openaiOrganizationHeader);
|
console.log("[Org ID]", openaiOrganizationHeader);
|
||||||
} else {
|
} else {
|
||||||
console.log("[Org ID] is not set up.");
|
// console.log("[Org ID] is not set up.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// to prevent browser prompt for credentials
|
// to prevent browser prompt for credentials
|
||||||
@ -196,6 +196,7 @@ export async function saveLogs(logData: {
|
|||||||
getTokenLength(matchAllMessage.join(" ")) +
|
getTokenLength(matchAllMessage.join(" ")) +
|
||||||
matchAllMessage.length * 3;
|
matchAllMessage.length * 3;
|
||||||
}
|
}
|
||||||
|
console.log("[debug log]----", logData);
|
||||||
delete logData?.logEntry;
|
delete logData?.logEntry;
|
||||||
}
|
}
|
||||||
if (logData?.model == "midjourney") {
|
if (logData?.model == "midjourney") {
|
||||||
@ -205,8 +206,16 @@ export async function saveLogs(logData: {
|
|||||||
console.log("[LOG]", "logToken", e);
|
console.log("[LOG]", "logToken", e);
|
||||||
logData.logToken = 0;
|
logData.logToken = 0;
|
||||||
}
|
}
|
||||||
const result = await prisma.logEntry.create({
|
try {
|
||||||
data: logData,
|
const result = await prisma.logEntry.create({
|
||||||
});
|
data: logData,
|
||||||
|
});
|
||||||
|
} catch {
|
||||||
|
delete logData?.userID;
|
||||||
|
const result = await prisma.logEntry.create({
|
||||||
|
data: logData,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// console.log("result", result)
|
// console.log("result", result)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user