mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-17 06:23:44 +08:00
修复小细节
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user