From 1a704f1c255ef5e60c8143544356a9d0e867a8e8 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 8 Apr 2025 10:51:35 +0800 Subject: [PATCH] fix: Workflow debugging for authorized applications will result in an error message indicating unauthorized access to the model (#2819) --- apps/application/views/chat_views.py | 2 +- ui/src/components/ai-chat/index.vue | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/application/views/chat_views.py b/apps/application/views/chat_views.py index e9d3e2106..0415f8208 100644 --- a/apps/application/views/chat_views.py +++ b/apps/application/views/chat_views.py @@ -97,7 +97,7 @@ class ChatView(APIView): tags=[_("Application/Chat")]) def post(self, request: Request): return result.success(ChatSerializers.OpenWorkFlowChat( - data={**request.data, 'user_id': request.user.id}).open()) + data={'user_id': request.user.id, **request.data}).open()) class OpenTemp(APIView): authentication_classes = [TokenAuth] diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 036f4104a..2732af577 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -268,8 +268,10 @@ const openChatId: () => Promise = () => { }) } else { if (isWorkFlow(obj.type)) { + console.log(obj) const submitObj = { - work_flow: obj.work_flow + work_flow: obj.work_flow, + user_id: obj.user } return applicationApi.postWorkflowChatOpen(submitObj).then((res) => { chartOpenId.value = res.data