mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
修复小细节
This commit is contained in:
parent
1e7d20580d
commit
b0e56e17c7
@ -52,6 +52,7 @@ RUN rm -f .env
|
||||
|
||||
EXPOSE 3000
|
||||
ENV KEEP_ALIVE_TIMEOUT=30
|
||||
ENV HOSTNAME=""
|
||||
|
||||
CMD if [ -n "$PROXY_URL" ]; then \
|
||||
export HOSTNAME="127.0.0.1"; \
|
||||
|
@ -13,13 +13,17 @@ async function handle(
|
||||
await insertUser({ name: request_data?.userName });
|
||||
}
|
||||
// console.log("===========4", request_data);
|
||||
if (request_data?.logEntry) {
|
||||
const regex = /\[(.*)]/g;
|
||||
const matchResponse = request_data.logEntry.match(regex);
|
||||
if (matchResponse.length > 0) {
|
||||
request_data.logToken = getTokenLength(matchResponse[0]);
|
||||
try {
|
||||
if (request_data?.logEntry) {
|
||||
const regex = /\[(.*)]/g;
|
||||
const matchResponse = request_data.logEntry.match(regex);
|
||||
if (matchResponse.length > 0) {
|
||||
request_data.logToken = getTokenLength(matchResponse[0]);
|
||||
}
|
||||
}
|
||||
// console.log('=======', request_data.logEntry, '=====', matchResponse);
|
||||
} catch (e) {
|
||||
console.log("[LOG]", "logToken", e);
|
||||
request_data.logToken = 0;
|
||||
}
|
||||
|
||||
await prisma.logEntry.create({
|
||||
|
@ -77,7 +77,8 @@ async function handle(
|
||||
|
||||
try {
|
||||
const protocol = req.headers.get("x-forwarded-proto") || "http";
|
||||
const baseUrl = process.env.NEXTAUTH_URL ?? "http://localhost:3000";
|
||||
//const baseUrl = process.env.NEXTAUTH_URL ?? "http://localhost:3000";
|
||||
const baseUrl = "http://localhost:3000";
|
||||
const ip = getIP(req);
|
||||
// 对其进行 Base64 解码
|
||||
let h_userName = req.headers.get("x-request-name");
|
||||
|
@ -65,14 +65,16 @@ export default async function UsageByModel() {
|
||||
0,
|
||||
0,
|
||||
);
|
||||
const endOfTheDayInTimeZone = new Date(
|
||||
today.getFullYear(),
|
||||
today.getMonth(),
|
||||
today.getDate(),
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
); // 当天的结束时间
|
||||
// const endOfTheDayInTimeZone = new Date(
|
||||
// today.getFullYear(),
|
||||
// today.getMonth(),
|
||||
// today.getDate(),
|
||||
// 23,
|
||||
// 59,
|
||||
// 59,
|
||||
// ); // 当天的结束时间
|
||||
const endOfTheDayInTimeZone = addHours(startOfTheDayInTimeZone, +24); // 当天的结束时间
|
||||
|
||||
// const startDate = addHours(startOfTheDayInTimeZone, -8);
|
||||
// const endDate = addHours(endOfTheDayInTimeZone, -8);
|
||||
console.log("===", today, startOfTheDayInTimeZone, endOfTheDayInTimeZone);
|
||||
|
Loading…
Reference in New Issue
Block a user