修复网易云无法登录的问题 - #1250
Open
reserveword wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
实测不能修复登录问题,新版electron将cookie的samesite默认为lax,我们需要重新设置MUSIC_U字段。NMTID字段则不需要设置。 |
经实测新版electron会将samesite值默认设为lax,因此网易云网页版设置给浏览器的MUSIC_U字段需要由客户端读取并重新设置为no_restriction才能正常登录。 此处修改了netease.js中的get_user函数和ne_ensure_cookie函数,在请求用户信息前先检查MUSIC_U字段的samesite值,如果不为no_restriction则重新设置一次。
当登陆状态失效后,重新登录不会刷新本地保存的cookie,导致重新登录后仍然使用旧的cookie。现在在检测到登录失败时调用 `this.logout` 方法,清除登录状态,以便用户可以重新登录。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.