chatgpt-web-dev / chatgpt-web

A third-party ChatGPT Web UI page built with Express and Vue3, through the official OpenAI completion API. / 用 Express 和 Vue3 搭建的第三方 ChatGPT 前端页面, 基于 OpenAI 官方 completion API.
https://chatgpt-web.dev
MIT License
1.6k stars 440 forks source link

fix: attempting to fix the req /session 500 error #419

Closed BobDu closed 6 months ago

BobDu commented 6 months ago

ref: #418 看起来只有可能是在 https://github.com/chatgpt-web-dev/chatgpt-web/blob/39e94f258f6333842ff298f37b5108a75344f314/service/src/index.ts#L600 这里 user 为 null 了才能返回这么个错误导致页面跳转 500

再往上看又只能是 在mongo中没有查询到这个userId的情况下才会执行到这么个路径。 但是为什么数据库会查不到就想不明白了。

ping @Kerwin1202 做个判空处理先避免页面500要求重新登录如何?

Kerwin1202 commented 6 months ago

可以 null 再输出一下 userid 以及 页面传入的 token 呢,看看有啥异常数据

BobDu commented 6 months ago

可以 null 再输出一下 userid 以及 页面传入的 token 呢,看看有啥异常数据

Done.