本地docker部署,将发布的应用链接嵌入到iframe中,问答时报错 #80

Closed
opened 2026-02-21 17:25:54 -05:00 by yindo · 3 comments
Owner

Originally created by @lin-xiaosheng on GitHub (May 22, 2023).

直接打开链接可以正常问答,但在iframe中显示如下报错:
1185c90d2c8763f008bb19cec6ba7722
请求地址:api/messages?conversation_id=d4692a48-4cc3-4859-a57b-ac995dba4ee8&limit=20&last_id=
响应:
{
"code": "not_found",
"message": "Conversation Not Exists.",
"status": 404
}
请问一下是哪里出的问题,是否是不允许使用iframe嵌入或方式不对?
非常感谢,如果需要进一步的日志信息请告诉我

Originally created by @lin-xiaosheng on GitHub (May 22, 2023). 直接打开链接可以正常问答,但在iframe中显示如下报错: ![1185c90d2c8763f008bb19cec6ba7722](https://github.com/langgenius/dify/assets/131971238/173f6bac-2d72-41e5-b5b0-dd68913887e3) 请求地址:api/messages?conversation_id=d4692a48-4cc3-4859-a57b-ac995dba4ee8&limit=20&last_id= 响应: { "code": "not_found", "message": "Conversation Not Exists.", "status": 404 } 请问一下是哪里出的问题,是否是不允许使用iframe嵌入或方式不对? 非常感谢,如果需要进一步的日志信息请告诉我
yindo closed this issue 2026-02-21 17:25:54 -05:00
Author
Owner

@yancymin commented on GitHub (May 22, 2023):

我也遇到了 iframe 报错,不能连续对话

@yancymin commented on GitHub (May 22, 2023): 我也遇到了 iframe 报错,不能连续对话
Author
Owner

@lin-xiaosheng commented on GitHub (May 22, 2023):

目前进一步排查之后发现问题出在cookie的session中。
image
当删除session后报错可以复现。

@lin-xiaosheng commented on GitHub (May 22, 2023): 目前进一步排查之后发现问题出在cookie的session中。 ![image](https://github.com/langgenius/dify/assets/131971238/e75b3c76-164b-4015-8831-117cd2b60aef) 当删除session后报错可以复现。
Author
Owner

@crazywoola commented on GitHub (May 22, 2023):

@yancymin @lin-xiaosheng 嵌入iframe的确会有这个问题,cors 的策略比较严格,限制了在相同域名下才可以访问到这个cookie,如果确实想要单独这个页面支持嵌入,只需要单独部署这个 Chat 就可以了。

@crazywoola commented on GitHub (May 22, 2023): @yancymin @lin-xiaosheng 嵌入iframe的确会有这个问题,cors 的策略比较严格,限制了在相同域名下才可以访问到这个cookie,如果确实想要单独这个页面支持嵌入,只需要单独部署这个 [Chat](https://github.com/langgenius/webapp-conversation) 就可以了。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#80