diff --git a/projects/app/src/pages/api/core/chat/updateHistory.ts b/projects/app/src/pages/api/core/chat/updateHistory.ts index 634604894e3..7a434d7ac3d 100644 --- a/projects/app/src/pages/api/core/chat/updateHistory.ts +++ b/projects/app/src/pages/api/core/chat/updateHistory.ts @@ -9,12 +9,13 @@ import { autChatCrud } from '@/service/support/permission/auth/chat'; export default async function handler(req: NextApiRequest, res: NextApiResponse) { try { await connectToDatabase(); - const { appId, chatId, shareId, outLinkUid, customTitle, top } = req.body as UpdateHistoryProps; - + const { appId, chatId, teamId, shareId, outLinkUid, customTitle, top } = + req.body as UpdateHistoryProps; await autChatCrud({ req, authToken: true, appId, + teamId, chatId, shareId, outLinkUid, diff --git a/projects/app/src/web/common/api/request.ts b/projects/app/src/web/common/api/request.ts index 39b6b3112e8..489fefaf746 100644 --- a/projects/app/src/web/common/api/request.ts +++ b/projects/app/src/web/common/api/request.ts @@ -102,7 +102,9 @@ function responseError(err: any) { if (err?.code in TOKEN_ERROR_CODE) { clearToken(); - if (window.location.pathname !== '/chat/share') { + if ( + !(window.location.pathname === '/chat/share' || window.location.pathname === '/chat/team') + ) { window.location.replace( `/login?lastRoute=${encodeURIComponent(location.pathname + location.search)}` );