10
10
import * as cp from "child_process" ;
11
11
import * as systemUtils from "../utils/SystemUtils" ;
12
12
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" ;
15
14
import { createEnvOption } from "../utils/CliUtils" ;
16
15
import { logOutput , promptForOpenOutputChannel } from "../utils/OutputUtils" ;
17
16
import { eventService } from "../service/EventService" ;
18
- import { window } from "vscode" ;
17
+ import { window , QuickPickOptions } from "vscode" ;
19
18
import { statusBarService } from "../service/StatusBarService" ;
20
19
import { treeDataService } from "../service/TreeDataService" ;
21
20
import { getLeetCodeEndpoint } from "../utils/ConfigUtils" ;
@@ -28,12 +27,21 @@ class LoginContorller {
28
27
// 登录操作
29
28
public async signIn ( ) : Promise < void > {
30
29
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 ( {
33
38
label : "LeetCode Account" ,
34
39
detail : "只能登录leetcode.cn" ,
35
40
value : "LeetCode" ,
36
- } ,
41
+ } ) ;
42
+ qpOpiton . title = "正在登录中文版leetcode.cn" ;
43
+ }
44
+ picks . push (
37
45
{
38
46
label : "Third-Party: GitHub" ,
39
47
detail : "Use GitHub account to login" ,
@@ -50,7 +58,7 @@ class LoginContorller {
50
58
value : "Cookie" ,
51
59
} ,
52
60
) ;
53
- const choice : IQuickItemEx < string > | undefined = await window . showQuickPick ( picks ) ;
61
+ const choice : IQuickItemEx < string > | undefined = await window . showQuickPick ( picks , qpOpiton ) ;
54
62
if ( ! choice ) {
55
63
return ;
56
64
}
0 commit comments