File tree Expand file tree Collapse file tree
src/main/kotlin/stageguard/sctimetable/api/edu_system/super Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,12 +88,12 @@ object SuperCourseApiService {
8888 }.execute { response ->
8989 var cookieList: List <String > = arrayListOf (" " , " " )
9090 response.headers.forEach { s: String , list: List <String > ->
91- if (s.contains(" Cookie " )) {
91+ if (s.contains(" set-cookie " )) {
9292 cookieList = list
9393 return @forEach
9494 }
9595 }
96- cookieBlock ?.invoke(LoginCookieData (cookieList[0 ].let {
96+ cookieBlock?.invoke(LoginCookieData (cookieList[0 ].let {
9797 val jSessionMatcher = jSessionIdRegExp.matcher(it)
9898 if (jSessionMatcher.find()) {
9999 jSessionMatcher.group(1 )
@@ -106,7 +106,6 @@ object SuperCourseApiService {
106106 }))
107107 // 超级课表的api可真是狗屎,逼我自定义一个Either
108108 val result = (response.content.readUTF8Line() ? : " {\" data\" :{\" errorStr\" :\" Empty response content.\" },\" status\" :1}" )
109- // println(result)
110109 if (Pattern .compile(" errorStr" ).matcher(result).find()) {
111110 Either .Right (Json .decodeFromString(result))
112111 } else {
You can’t perform that action at this time.
0 commit comments