Fix share page whisper auth (#1161)

Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-04-09 21:38:47 +08:00
committed by GitHub
parent adfad8ff7f
commit 2991c07467
55 changed files with 466 additions and 251 deletions

View File

@@ -9,6 +9,7 @@ import { pushWhisperUsage } from '@/service/support/wallet/usage/push';
import { authChatCert } from '@/service/support/permission/auth/chat';
import { MongoApp } from '@fastgpt/service/core/app/schema';
import { getGuideModule, splitGuideModule } from '@fastgpt/global/core/module/utils';
import { OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat';
const upload = getUploadModel({
maxSize: 2
@@ -20,15 +21,16 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
try {
const {
file,
data: { appId, duration, teamId: spaceTeamId, teamToken }
} = await upload.doUpload<{
appId: string;
duration: number;
shareId?: string;
teamId?: string;
teamToken?: string;
}>(req, res);
data: { appId, duration, shareId, outLinkUid, teamId: spaceTeamId, teamToken }
} = await upload.doUpload<
OutLinkChatAuthProps & {
appId: string;
duration: number;
}
>(req, res);
req.body.shareId = shareId;
req.body.outLinkUid = outLinkUid;
req.body.teamId = spaceTeamId;
req.body.teamToken = teamToken;