Skip to content

Commit

Permalink
3.1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
ccagml committed Feb 20, 2024
1 parent a941a3b commit d08240c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# version 3.1.17

- 修改题目 Tag 中 stack 的中文翻译 堆 -> 栈
- cookie 登录改为分别输入 LEETCODE_SESSION 和 csrftoken 的值, 避免格式解析失败
- 补充部分题目 tag 数据
- 更新基础的题目分数数据 resources/data.json

# version 3.1.16

- 会话已过期提示
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-leetcode-problem-rating",
"displayName": "LeetCode",
"description": "%main.description%",
"version": "3.1.16",
"version": "3.1.17",
"author": "ccagml",
"publisher": "ccagml",
"license": "MIT",
Expand Down
17 changes: 15 additions & 2 deletions src/childCall/childCallModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,24 @@ class ExecuteService implements Disposable {
title: '正确的cookie例子csrftoken="xxx"; LEETCODE_SESSION="yyy";',
prompt: "输入例子中LEETCODE_SESSION的值yyy",
ignoreFocusOut: true,
validateInput: (s: string): string | undefined => (s ? undefined : "LEETCODE_SESSION不为空"),
validateInput: (s: string): string | undefined => (s && s.trim() ? undefined : "LEETCODE_SESSION不为空"),
});

if (cf_v && ls_v) {
pwd = `csrftoken="${cf_v}";LEETCODE_SESSION="${ls_v}";`;
let cf_v_t = cf_v.trim();
let ls_v_t = ls_v.trim();
// 判断输入的有没有 " '
let cf_flag = cf_v_t[0] == '"' || cf_v_t[0] == "'";
let ls_flag = ls_v_t[0] == '"' || ls_v_t[0] == "'";
if (cf_flag && ls_flag) {
pwd = `csrftoken=${cf_v_t};LEETCODE_SESSION=${ls_v_t};`;
} else if (cf_flag) {
pwd = `csrftoken=${cf_v_t};LEETCODE_SESSION="${ls_v_t}";`;
} else if (ls_flag) {
pwd = `csrftoken="${cf_v_t}";LEETCODE_SESSION=${ls_v_t};`;
} else {
pwd = `csrftoken="${cf_v_t}";LEETCODE_SESSION="${ls_v_t}";`;
}
}
// csrftoken="xxxx"; LEETCODE_SESSION="xxxx";
} else {
Expand Down

0 comments on commit d08240c

Please sign in to comment.