diff --git a/external-library/mywust b/external-library/mywust index 5fd5099..c13aa2f 160000 --- a/external-library/mywust +++ b/external-library/mywust @@ -1 +1 @@ -Subproject commit 5fd50991814322760c7f4fb8b17a51ae8270e973 +Subproject commit c13aa2f56f1ad3b1ab8475f1674f5851fa2f90da diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java index c40c566..c652ff6 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java @@ -68,6 +68,8 @@ public class UndergradRpcException extends RpcException { AUTH_USER_DISABLED, // 用户账号需要更改 AUTH_NEED_CHANGE_PASSWORD, + // 专属选课时间段账号被禁用(--> _ -->) + AUTH_BANNED_IN_EXCLUSIVE_TIME, AUTH_UNKNOWN_ERROR } } diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java index c4fc1fa..a0177ba 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java @@ -41,7 +41,9 @@ public class LoginService { public boolean verify(String cookie) throws UndergradRpcException { try { - return !undergraduateLogin.checkCookiesFail(cookie); + return undergraduateLogin.testCookie(cookie); + } catch (ApiException e) { + return false; } catch (IOException e) { throw new UndergradRpcException( UndergradRpcException.TypeCode.NETWORK_EXCEPTION, @@ -59,6 +61,7 @@ public class LoginService { case UNI_LOGIN_USER_BANNED -> UndergradRpcException.ErrorCode.AUTH_USER_BANNED; case UNI_LOGIN_USER_DISABLED -> UndergradRpcException.ErrorCode.AUTH_USER_DISABLED; case UNI_LOGIN_NEED_CHANGE_PASSWORD -> UndergradRpcException.ErrorCode.AUTH_NEED_CHANGE_PASSWORD; + case UNDERGRAD_BANNED_IN_EXCLUSIVE_TIME -> UndergradRpcException.ErrorCode.AUTH_BANNED_IN_EXCLUSIVE_TIME; case UNI_LOGIN_USER_NOT_ONLY -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; case UNI_LOGIN_NO_REGISTER -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR; case UNI_LOGIN_NEED_TFA -> UndergradRpcException.ErrorCode.AUTH_UNKNOWN_ERROR;