fix: permission for favourite apps chatting (#5668)

This commit is contained in:
伍闲犬
2025-09-17 18:31:17 +08:00
committed by GitHub
parent fb536d1697
commit ae3fbafa34
2 changed files with 9 additions and 0 deletions

View File

@@ -114,6 +114,10 @@ export const authAppByTmbId = async ({
const Per = new AppPermission({ role: sumPer(folderPer, myPer), isOwner });
if (app.favourite || app.quick) {
Per.addRole(ReadRoleVal);
}
if (!Per.checkPer(per)) {
return Promise.reject(AppErrEnum.unAuthApp);
}

View File

@@ -27,6 +27,7 @@ import ChatHistorySidebar from '@/pageComponents/chat/slider/ChatSliderSidebar';
import ChatSliderMobileDrawer from '@/pageComponents/chat/slider/ChatSliderMobileDrawer';
import dynamic from 'next/dynamic';
import { getNanoid } from '@fastgpt/global/common/string/tools';
import { ChatErrEnum } from '@fastgpt/global/common/error/code/chat';
const CustomPluginRunBox = dynamic(() => import('@/pageComponents/chat/CustomPluginRunBox'));
@@ -78,6 +79,10 @@ const AppChatWindow = ({ myApps }: Props) => {
errorToast: '',
onError(e: any) {
if (e?.code && e.code >= 502000) {
if (e?.statusText === ChatErrEnum.unAuthChat) {
onChangeChatId();
return;
}
handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS);
}
},