mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "app",
|
||||
"version": "4.8.14",
|
||||
"version": "4.8.15",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
@@ -8,16 +8,17 @@ import { authChatCrud } from '@/service/support/permission/auth/chat';
|
||||
import { OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat';
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { aiTranscriptions } from '@fastgpt/service/core/ai/audio/transcriptions';
|
||||
import { useReqFrequencyLimit } from '@fastgpt/service/common/middle/reqFrequencyLimit';
|
||||
|
||||
const upload = getUploadModel({
|
||||
maxSize: 20
|
||||
maxSize: 5
|
||||
});
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
let filePaths: string[] = [];
|
||||
|
||||
try {
|
||||
const {
|
||||
let {
|
||||
file,
|
||||
data: { appId, duration, shareId, outLinkUid, teamId: spaceTeamId, teamToken }
|
||||
} = await upload.doUpload<
|
||||
@@ -42,9 +43,17 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
if (!file) {
|
||||
throw new Error('file not found');
|
||||
}
|
||||
if (duration === undefined) {
|
||||
throw new Error('duration not found');
|
||||
}
|
||||
duration = duration < 1 ? 1 : duration;
|
||||
|
||||
// auth role
|
||||
const { teamId, tmbId } = await authChatCrud({ req, authToken: true, ...req.body });
|
||||
const { teamId, tmbId } = await authChatCrud({
|
||||
req,
|
||||
authToken: true,
|
||||
...req.body
|
||||
});
|
||||
|
||||
// auth app
|
||||
// const app = await MongoApp.findById(appId, 'modules').lean();
|
||||
@@ -80,7 +89,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
removeFilesByPaths(filePaths);
|
||||
}
|
||||
|
||||
export default NextAPI(handler);
|
||||
export default NextAPI(useReqFrequencyLimit(1, 2), handler);
|
||||
|
||||
export const config = {
|
||||
api: {
|
||||
|
@@ -141,7 +141,7 @@ export const AiPointsTable = () => {
|
||||
<Box flex={'1 0 0'}>
|
||||
{whisperModel?.charsPointsPrice +
|
||||
t('common:support.wallet.subscription.point') +
|
||||
' / 1000' +
|
||||
' / 60' +
|
||||
t('common:unit.minute')}
|
||||
</Box>
|
||||
</Flex>
|
||||
|
@@ -103,7 +103,7 @@ export const useAudioPlay = (
|
||||
const cancelAudio = useCallback(() => {
|
||||
try {
|
||||
window.speechSynthesis?.cancel();
|
||||
audioController.current.abort('');
|
||||
!audioController.current.signal.aborted && audioController.current.abort();
|
||||
} catch (error) {}
|
||||
if (audioRef.current) {
|
||||
audioRef.current.pause();
|
||||
|
Reference in New Issue
Block a user