mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
修复一下图表的bug
This commit is contained in:
parent
3dfb559dc0
commit
5aef4ed70f
@ -66,8 +66,8 @@ async function handle(req: NextRequest) {
|
|||||||
const todayLog = await prisma.logEntry.findMany({
|
const todayLog = await prisma.logEntry.findMany({
|
||||||
where: {
|
where: {
|
||||||
createdAt: {
|
createdAt: {
|
||||||
gte: startOfTheDayInTimeZone, // gte 表示 '大于等于'
|
gte: startOfTheDayInTimeZone.toISOString(), // gte 表示 '大于等于'
|
||||||
lte: endOfTheDayInTimeZone, // lte 表示 '小于等于'
|
lte: endOfTheDayInTimeZone.toISOString(), // lte 表示 '小于等于'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
|
@ -156,7 +156,7 @@ export async function requestLog(
|
|||||||
const logData = {
|
const logData = {
|
||||||
ip: ip,
|
ip: ip,
|
||||||
path: url_path,
|
path: url_path,
|
||||||
// logEntry: JSON.stringify(jsonBody),
|
logEntry: JSON.stringify(jsonBody),
|
||||||
model: url_path.startsWith("mj/") ? "midjourney" : jsonBody?.model, // 后面尝试请求是添加到参数
|
model: url_path.startsWith("mj/") ? "midjourney" : jsonBody?.model, // 后面尝试请求是添加到参数
|
||||||
userName: h_userName,
|
userName: h_userName,
|
||||||
};
|
};
|
||||||
|
@ -26,8 +26,6 @@ async function handle(
|
|||||||
// console.log("===========4", request_data);
|
// console.log("===========4", request_data);
|
||||||
try {
|
try {
|
||||||
if (request_data?.logEntry) {
|
if (request_data?.logEntry) {
|
||||||
// const regex = /\[(.*)]/g;
|
|
||||||
// const matchResponse = request_data.logEntry.match(regex);
|
|
||||||
const regex_message = /(?<="content":")(.*?)(?="}[,\]])/g;
|
const regex_message = /(?<="content":")(.*?)(?="}[,\]])/g;
|
||||||
const matchAllMessage = request_data.logEntry.match(regex_message);
|
const matchAllMessage = request_data.logEntry.match(regex_message);
|
||||||
// console.log(matchAllMessage, "=====");
|
// console.log(matchAllMessage, "=====");
|
||||||
@ -35,8 +33,6 @@ async function handle(
|
|||||||
request_data.logToken =
|
request_data.logToken =
|
||||||
getTokenLength(matchAllMessage.join(" ")) +
|
getTokenLength(matchAllMessage.join(" ")) +
|
||||||
matchAllMessage.length * 3;
|
matchAllMessage.length * 3;
|
||||||
} else {
|
|
||||||
request_data.logToken = 0;
|
|
||||||
}
|
}
|
||||||
delete request_data["logEntry"];
|
delete request_data["logEntry"];
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ const SECURE_COOKIES:boolean = !!process.env.SECURE_COOKIES;
|
|||||||
|
|
||||||
export const authOptions: NextAuthOptions = {
|
export const authOptions: NextAuthOptions = {
|
||||||
// debug: !VERCEL_DEPLOYMENT,
|
// debug: !VERCEL_DEPLOYMENT,
|
||||||
debug: SECURE_COOKIES,
|
debug: !SECURE_COOKIES,
|
||||||
useSecureCookies: SECURE_COOKIES,
|
useSecureCookies: SECURE_COOKIES,
|
||||||
secret: process.env.NEXTAUTH_SECRET,
|
secret: process.env.NEXTAUTH_SECRET,
|
||||||
providers: [
|
providers: [
|
||||||
|
Loading…
Reference in New Issue
Block a user