Skip to content

修复网易云无法登录的问题 - #1250

Open
reserveword wants to merge 3 commits into
listen1:masterfrom
reserveword:master
Open

修复网易云无法登录的问题#1250
reserveword wants to merge 3 commits into
listen1:masterfrom
reserveword:master

Conversation

@reserveword

Copy link
Copy Markdown
Contributor

No description provided.

@reserveword reserveword closed this May 5, 2026
@reserveword

Copy link
Copy Markdown
Contributor Author

实测不能修复登录问题,新版electron将cookie的samesite默认为lax,我们需要重新设置MUSIC_U字段。NMTID字段则不需要设置。

@reserveword reserveword reopened this May 5, 2026
经实测新版electron会将samesite值默认设为lax,因此网易云网页版设置给浏览器的MUSIC_U字段需要由客户端读取并重新设置为no_restriction才能正常登录。
此处修改了netease.js中的get_user函数和ne_ensure_cookie函数,在请求用户信息前先检查MUSIC_U字段的samesite值,如果不为no_restriction则重新设置一次。
当登陆状态失效后,重新登录不会刷新本地保存的cookie,导致重新登录后仍然使用旧的cookie。现在在检测到登录失败时调用 `this.logout` 方法,清除登录状态,以便用户可以重新登录。
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

Successfully merging this pull request may close these issues.

1 participant