Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(getUserInfo): using userStatus.isPremium#52

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
soraliu wants to merge1 commit intoleetcode-tools:master
base:master
Choose a base branch
Loading
fromsoraliu:master
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletionslib/plugins/leetcode.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -408,7 +408,9 @@ plugin.getUserInfo = function(cb) {
'{',
' user {',
' username',
' isCurrentUserPremium',
' }',
' userStatus {',
' isPremium',
' }',
'}'
].join('\n'),
Expand All@@ -422,7 +424,8 @@ plugin.getUserInfo = function(cb) {
if (e) return cb(e);

const user = body.data.user;
return cb(null, user);
const userStatus = body.data.userStatus;
return cb(null, user, userStatus);
});
};

Expand DownExpand Up@@ -514,9 +517,9 @@ plugin.getUser = function(user, cb) {
log.warn('Failed to retrieve user favorites: ' + e);
}

plugin.getUserInfo(function(e, _user) {
plugin.getUserInfo(function(e, _user, _userStatus) {
if (!e) {
user.paid =_user.isCurrentUserPremium;
user.paid =_userStatus.isPremium
user.name = _user.username;
}
session.saveUser(user);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp