perf: user openai

This commit is contained in:
archer
2023-08-05 12:26:26 +08:00
parent 37a6293f5e
commit bb824ab35e
6 changed files with 23 additions and 20 deletions

View File

@@ -3,7 +3,7 @@ import { jsonRes } from '@/service/response';
import { connectToDatabase, App } from '@/service/mongo';
import type { PagingData } from '@/types';
import type { ShareAppItem } from '@/types/app';
import { parseCookie } from '@/service/utils/auth';
import { authUser } from '@/service/utils/auth';
import { Types } from 'mongoose';
/* 获取模型列表 */
@@ -17,13 +17,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
await connectToDatabase();
let userId = '';
try {
userId = await parseCookie(req.headers.cookie);
} catch (error) {
error;
}
const { userId } = await authUser({ req, authToken: true });
const regex = new RegExp(searchText, 'i');