@@ -468,13 +468,34 @@ class ExecuteService implements Disposable {
468
468
}
469
469
child_process . stdin ?. write ( `${ name } \n` ) ;
470
470
const isByCookie : boolean = arg . loginMethod === "Cookie" ;
471
- const pwd : string | undefined = await window . showInputBox ( {
472
- prompt : isByCookie ? "Enter cookie" : "Enter password." ,
473
- password : true ,
474
- ignoreFocusOut : true ,
475
- validateInput : ( s : string ) : string | undefined =>
476
- s ? undefined : isByCookie ? "Cookie must not be empty" : "Password must not be empty" ,
477
- } ) ;
471
+ let pwd : string | undefined = undefined ;
472
+ if ( isByCookie ) {
473
+ let cf_v = await window . showInputBox ( {
474
+ title : '正确的cookie例子csrftoken="xxx"; LEETCODE_SESSION="yyy";' ,
475
+ prompt : "输入例子中csrftoken的值xxx" ,
476
+ ignoreFocusOut : true ,
477
+ validateInput : ( s : string ) : string | undefined => ( s ? undefined : "csrftoken不为空" ) ,
478
+ } ) ;
479
+ let ls_v = await window . showInputBox ( {
480
+ title : '正确的cookie例子csrftoken="xxx"; LEETCODE_SESSION="yyy";' ,
481
+ prompt : "输入例子中LEETCODE_SESSION的值yyy" ,
482
+ ignoreFocusOut : true ,
483
+ validateInput : ( s : string ) : string | undefined => ( s ? undefined : "LEETCODE_SESSION不为空" ) ,
484
+ } ) ;
485
+
486
+ if ( cf_v && ls_v ) {
487
+ pwd = `csrftoken="${ cf_v } ";LEETCODE_SESSION="${ ls_v } ";` ;
488
+ }
489
+ // csrftoken="xxxx"; LEETCODE_SESSION="xxxx";
490
+ } else {
491
+ pwd = await window . showInputBox ( {
492
+ prompt : "Enter password." ,
493
+ password : true ,
494
+ ignoreFocusOut : true ,
495
+ validateInput : ( s : string ) : string | undefined => ( s ? undefined : "Password must not be empty" ) ,
496
+ } ) ;
497
+ }
498
+
478
499
if ( ! pwd ) {
479
500
child_process . kill ( ) ;
480
501
return resolve ( undefined ) ;
0 commit comments