mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-05 22:55:27 +00:00
feat: vision model (#489)
* mongo init * perf: mongo connect * perf: tts perf: whisper and tts peref: tts whisper permission log reabase (#488) * perf: modal * i18n * perf: schema lean * feat: vision model format * perf: tts loading * perf: static data * perf: tts * feat: image * perf: image * perf: upload image and title * perf: image size * doc * perf: color * doc * speaking can not select file * doc
This commit is contained in:
@@ -4,17 +4,18 @@ import { connectToDatabase } from '@/service/mongo';
|
||||
import { authCert } from '@fastgpt/service/support/permission/auth/common';
|
||||
import { uploadMongoImg } from '@fastgpt/service/common/file/image/controller';
|
||||
|
||||
type Props = { base64Img: string };
|
||||
type Props = { base64Img: string; expiredTime?: Date };
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
try {
|
||||
await connectToDatabase();
|
||||
const { userId } = await authCert({ req, authToken: true });
|
||||
const { base64Img } = req.body as Props;
|
||||
const { teamId } = await authCert({ req, authToken: true });
|
||||
const { base64Img, expiredTime } = req.body as Props;
|
||||
|
||||
const data = await uploadMongoImg({
|
||||
userId,
|
||||
base64Img
|
||||
teamId,
|
||||
base64Img,
|
||||
expiredTime
|
||||
});
|
||||
|
||||
jsonRes(res, { data });
|
||||
|
Reference in New Issue
Block a user