mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-17 16:45:02 +00:00
fix: permission for favourite apps chatting (#5668)
This commit is contained in:
@@ -114,6 +114,10 @@ export const authAppByTmbId = async ({
|
|||||||
|
|
||||||
const Per = new AppPermission({ role: sumPer(folderPer, myPer), isOwner });
|
const Per = new AppPermission({ role: sumPer(folderPer, myPer), isOwner });
|
||||||
|
|
||||||
|
if (app.favourite || app.quick) {
|
||||||
|
Per.addRole(ReadRoleVal);
|
||||||
|
}
|
||||||
|
|
||||||
if (!Per.checkPer(per)) {
|
if (!Per.checkPer(per)) {
|
||||||
return Promise.reject(AppErrEnum.unAuthApp);
|
return Promise.reject(AppErrEnum.unAuthApp);
|
||||||
}
|
}
|
||||||
|
@@ -27,6 +27,7 @@ import ChatHistorySidebar from '@/pageComponents/chat/slider/ChatSliderSidebar';
|
|||||||
import ChatSliderMobileDrawer from '@/pageComponents/chat/slider/ChatSliderMobileDrawer';
|
import ChatSliderMobileDrawer from '@/pageComponents/chat/slider/ChatSliderMobileDrawer';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
import { getNanoid } from '@fastgpt/global/common/string/tools';
|
import { getNanoid } from '@fastgpt/global/common/string/tools';
|
||||||
|
import { ChatErrEnum } from '@fastgpt/global/common/error/code/chat';
|
||||||
|
|
||||||
const CustomPluginRunBox = dynamic(() => import('@/pageComponents/chat/CustomPluginRunBox'));
|
const CustomPluginRunBox = dynamic(() => import('@/pageComponents/chat/CustomPluginRunBox'));
|
||||||
|
|
||||||
@@ -78,6 +79,10 @@ const AppChatWindow = ({ myApps }: Props) => {
|
|||||||
errorToast: '',
|
errorToast: '',
|
||||||
onError(e: any) {
|
onError(e: any) {
|
||||||
if (e?.code && e.code >= 502000) {
|
if (e?.code && e.code >= 502000) {
|
||||||
|
if (e?.statusText === ChatErrEnum.unAuthChat) {
|
||||||
|
onChangeChatId();
|
||||||
|
return;
|
||||||
|
}
|
||||||
handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS);
|
handlePaneChange(ChatSidebarPaneEnum.TEAM_APPS);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user