Skip to content

Commit 9f9e224

Browse files
committed
update
1 parent f9ce8e5 commit 9f9e224

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## version 2.0.0
22
- 重构
33
- 现在会从[zerotrac.github.io](https://zerotrac.github.io/leetcode_problem_rating/data.json)获取数据进行缓存
4+
- 登录选择优化
45
## version 1.1.10
56
- 更新数据
67

src/controller/LoginController.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
import * as cp from "child_process";
1111
import * as systemUtils from "../utils/SystemUtils";
1212
import { executeService } from "../service/ExecuteService";
13-
14-
import { DialogType, IQuickItemEx, loginArgsMapping, UserStatus } from "../model/Model";
13+
import { DialogType, Endpoint, IQuickItemEx, loginArgsMapping, UserStatus } from "../model/Model";
1514
import { createEnvOption } from "../utils/CliUtils";
1615
import { logOutput, promptForOpenOutputChannel } from "../utils/OutputUtils";
1716
import { eventService } from "../service/EventService";
18-
import { window } from "vscode";
17+
import { window, QuickPickOptions } from "vscode";
1918
import { statusBarService } from "../service/StatusBarService";
2019
import { treeDataService } from "../service/TreeDataService";
2120
import { getLeetCodeEndpoint } from "../utils/ConfigUtils";
@@ -28,12 +27,21 @@ class LoginContorller {
2827
// 登录操作
2928
public async signIn(): Promise<void> {
3029
const picks: Array<IQuickItemEx<string>> = [];
31-
picks.push(
32-
{
30+
let qpOpiton: QuickPickOptions = {
31+
title: "正在登录leetcode.com",
32+
matchOnDescription: false,
33+
matchOnDetail: false,
34+
placeHolder: "请选择登录方式",
35+
};
36+
if (getLeetCodeEndpoint() == Endpoint.LeetCodeCN) {
37+
picks.push({
3338
label: "LeetCode Account",
3439
detail: "只能登录leetcode.cn",
3540
value: "LeetCode",
36-
},
41+
});
42+
qpOpiton.title = "正在登录中文版leetcode.cn";
43+
}
44+
picks.push(
3745
{
3846
label: "Third-Party: GitHub",
3947
detail: "Use GitHub account to login",
@@ -50,7 +58,7 @@ class LoginContorller {
5058
value: "Cookie",
5159
},
5260
);
53-
const choice: IQuickItemEx<string> | undefined = await window.showQuickPick(picks);
61+
const choice: IQuickItemEx<string> | undefined = await window.showQuickPick(picks, qpOpiton);
5462
if (!choice) {
5563
return;
5664
}

0 commit comments

Comments
 (0)