mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-16 22:13:47 +08:00
初次优化认证
This commit is contained in:
@@ -1,20 +1,8 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import prisma from "@/lib/prisma";
|
||||
import { insertUser } from "@/lib/auth";
|
||||
// import { getTokenLength } from "@/app/utils/token";
|
||||
// import { Tiktoken } from "tiktoken/lite"
|
||||
// import cl100k_base from "tiktoken/encoders/cl100k_base.json"
|
||||
// import "tiktoken";
|
||||
// import { get_encoding } from "tiktoken";
|
||||
import { addHours, subMinutes } from "date-fns";
|
||||
import { getTokenLength } from "@/lib/utils";
|
||||
|
||||
// function getTokenLength(input: string): number {
|
||||
// const encoding = get_encoding("cl100k_base");
|
||||
// // console.log('tokens: ', input, encoding.countTokens())
|
||||
// return encoding.encode(input).length;
|
||||
// }
|
||||
|
||||
async function handle(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { path: string[] } },
|
||||
|
||||
Reference in New Issue
Block a user