mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
fix: permission for favourite apps chatting (#5668)
This commit is contained in:
parent
fb536d1697
commit
ae3fbafa34
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue