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

在本地部署前端时登入状态无法保持 #256

Open
AkutaZehy opened this issue Sep 20, 2024 · 5 comments
Open

在本地部署前端时登入状态无法保持 #256

AkutaZehy opened this issue Sep 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@AkutaZehy
Copy link
Member

其实老早就想提这个问题了。

通过本地的前端+后端部署,目前初步定位问题应该还是出在前端,原因尚在排查中。

@AkutaZehy AkutaZehy added the bug Something isn't working label Sep 20, 2024
@AkutaZehy AkutaZehy self-assigned this Sep 20, 2024
@AkutaZehy AkutaZehy added help wanted Extra attention is needed question Further information is requested labels Sep 20, 2024
@AkutaZehy
Copy link
Member Author

AkutaZehy commented Sep 20, 2024

本地部署前端和本地部署前端+后端均会出现此问题。

目前已经观测到的问题是:本地部署时,后端的userLoginController看上去无法正确对content.cookies执行修改。

我去不会又是异步问题吧

后编辑补充:经过检查,上面所述的一个问题似乎只会出现在本地前后端且前端使用HTTP启动。

如果确实是后端的问题,可能要考虑将该issue转移至后端。

@AkutaZehy
Copy link
Member Author

AkutaZehy commented Sep 21, 2024

目前可以确认,本地在HTTPS状态下启动连接本地后端可以正常登入;

本地HTTPS启动连接在线后端,或者本地HTTP启动连接本地后端依旧会出现类似的问题。

给我是整不会了,我排查暂时鸽了。

@otomad
Copy link
Member

otomad commented Sep 21, 2024

本地 HTTPS 启动本地后端肯定没问题。

但我只开发前端没必要拖着后端本地跑。

@cfdxkk
Copy link
Member

cfdxkk commented Sep 22, 2024

HTTP 当然会有问题,因为最新的 Chrome 等浏览器的 Cookie 政策非常严格。
文档 里写的是:"HTTP 开发服务器模式已经过测试,它一定不包含您预期中的某些功能。"

@cfdxkk
Copy link
Member

cfdxkk commented Sep 22, 2024

Cookie 工作原理参考:https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Cookies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants