Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] chatglm整合后,网页版正常运行, 而桌面版一直出现failed to fetch #3431

Closed
kakeelee opened this issue Dec 2, 2023 · 5 comments

Comments

@kakeelee
Copy link

kakeelee commented Dec 2, 2023

Describe the bug
作者你好,我部署chatglm在本机的wsl2中,使用测试脚本和本程序的网页版均可以正常对话。
但是当使用相同配置的桌面版时就会一直出现{ "error": true, "message": "Failed to fetch" },并且glm的控制台没有输出任何信息,这会是什么原因?
关于配置信息的截图:

  • 使用测试脚本可以正常对话
    00
  • 使用本项目的源码运行的web网页可以正常运行
    01
  • 使用相同版本的桌面版本出现问题
    01
@Yidadaa
Copy link
Collaborator

Yidadaa commented Dec 3, 2023

很有可能是跨域限制,检查你的 glm 代码是否关闭了跨域限制。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It is most likely a cross-domain restriction. Check whether your glm code has turned off cross-domain restrictions.

@kakeelee
Copy link
Author

kakeelee commented Dec 4, 2023

很有可能是跨域限制,检查你的 glm 代码是否关闭了跨域限制。

感谢您的回复, 关于关闭跨域限制,有下面几行代码,但是win客户端仍然存在该问题:

app = FastAPI(lifespan=lifespan)
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

是否还需要添加其他内容?

@Yidadaa
Copy link
Collaborator

Yidadaa commented Dec 6, 2023

由于客户端没有提供便捷地查看 log 功能,所以没办法针对你的问题进行排查,我建议你优先使用网页版,因为本项目是个网页优先项目,客户端发版和更新都不方便,也不及时。

@Yidadaa Yidadaa closed this as completed Dec 6, 2023
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Since the client does not provide a convenient log viewing function, there is no way to troubleshoot your problem. I recommend that you use the web version first. Because this project is a web-first project, it is inconvenient and untimely to release and update the client version. .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants