From 689b21b4569e9b83b03176db925188dd07d74a00 Mon Sep 17 00:00:00 2001 From: yihong Date: Sun, 8 Dec 2019 11:02:08 +0800 Subject: [PATCH] fix leetcode.cn change payload bug and fix typo in readme --- README.md | 2 +- lib/plugins/leetcode.cn.js | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 56bf57d8..3b9f4680 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Great thanks to leetcode.com, a really awesome website! Read help first $ leetcode help Login with your leetcode account $ leetcode user -l - Cookie login with cookie $ leetcode user -c + Cookie login with cookie $ leetcode user -c Browse all questions $ leetcode list Choose one question $ leetcode show 1 -g -l cpp Coding it! diff --git a/lib/plugins/leetcode.cn.js b/lib/plugins/leetcode.cn.js index 0095e0bd..4df528f3 100644 --- a/lib/plugins/leetcode.cn.js +++ b/lib/plugins/leetcode.cn.js @@ -97,12 +97,10 @@ plugin.getProblemsTitle = function(cb) { 'query getQuestionTranslation($lang: String) {', ' translations: allAppliedQuestionTranslations(lang: $lang) {', ' title', - ' question {', - ' questionId', + ' questionId', + ' __typename', ' }', - ' }', - '}', - '' + '}' ].join('\n'), variables: {}, operationName: 'getQuestionTranslation' @@ -116,7 +114,7 @@ plugin.getProblemsTitle = function(cb) { const titles = []; body.data.translations.forEach(function(x) { - titles[x.question.questionId] = x.title; + titles[x.questionId] = x.title; }); return cb(null, titles);