@@ -93,33 +93,27 @@ class PersonalInfoSession extends EhallSession {
93
93
"[ehall_session][getInformation] "
94
94
"Get the semester information." ,
95
95
);
96
- String get = await useApp ("4770397878132218" );
97
- await dioEhall.post (get );
98
- String semesterCode = await dioEhall
96
+ String ? location = await checkAndLogin (
97
+ target: "https://yjspt.xidian.edu.cn/gsapp/"
98
+ "sys/wdkbapp/*default/index.do#/xskcb" ,
99
+ sliderCaptcha: (String cookieStr) =>
100
+ SliderCaptchaClientProvider (cookie: cookieStr).solve (null ),
101
+ );
102
+
103
+ while (location != null ) {
104
+ var response = await dio.get (location);
105
+ log.info ("[getClasstable][getYjspt] Received location: $location ." );
106
+ location = response.headers[HttpHeaders .locationHeader]? [0 ];
107
+ }
108
+
109
+ var semesterCode = await dio
99
110
.post (
100
- "https://ehall .xidian.edu.cn/jwapp /sys/wdkb /modules/jshkcb/dqxnxq .do" ,
111
+ "https://yjspt .xidian.edu.cn/gsapp /sys/wdkbapp /modules/xskcb/kfdxnxqcx .do" ,
101
112
)
102
- .then ((value) => value.data['datas' ]['dqxnxq' ]['rows' ][0 ]['DM' ]);
103
-
104
- log.info (
105
- "[ehall_session][getInformation] "
106
- "Get the day the semester begin." ,
107
- );
108
- String termStartDay = await dioEhall.post (
109
- 'https://ehall.xidian.edu.cn/jwapp/sys/wdkb/modules/jshkcb/cxjcs.do' ,
110
- data: {
111
- 'XN' : '${semesterCode .split ('-' )[0 ]}-${semesterCode .split ('-' )[1 ]}' ,
112
- 'XQ' : semesterCode.split ('-' )[2 ]
113
- },
114
- ).then ((value) => value.data['datas' ]['cxjcs' ]['rows' ][0 ]["XQKSRQ" ]);
115
- preference.setString (
116
- preference.Preference .currentStartDay,
117
- termStartDay,
118
- );
119
- List <String > semester = semesterCode.split ("-" );
113
+ .then ((value) => value.data["datas" ]["kfdxnxqcx" ]["rows" ][0 ]["WID" ]);
120
114
preference.setString (
121
115
preference.Preference .currentSemester,
122
- semester.first + semester.last ,
116
+ semesterCode ,
123
117
);
124
118
}
125
119
@@ -238,22 +232,6 @@ class PersonalInfoSession extends EhallSession {
238
232
preference.Preference .currentSemester,
239
233
semesterCode,
240
234
);
241
-
242
- log.info (
243
- "[ehall_session][getInformation] "
244
- "Get the day the semester begin." ,
245
- );
246
- String termStartDay = await dioEhall.post (
247
- 'https://ehall.xidian.edu.cn/jwapp/sys/wdkb/modules/jshkcb/cxjcs.do' ,
248
- data: {
249
- 'XN' : '${semesterCode .split ('-' )[0 ]}-${semesterCode .split ('-' )[1 ]}' ,
250
- 'XQ' : semesterCode.split ('-' )[2 ]
251
- },
252
- ).then ((value) => value.data['datas' ]['cxjcs' ]['rows' ][0 ]["XQKSRQ" ]);
253
- preference.setString (
254
- preference.Preference .currentStartDay,
255
- termStartDay,
256
- );
257
235
}
258
236
259
237
return detailed["data" ]["SJH" ] ?? "02981891206" ;
0 commit comments