lensfrex 1 year ago
parent 3d7f498ca0
commit a43e157bac
Signed by: lensfrex
GPG Key ID: 0F69A0A2FBEE98A0
  1. 2
      external-library/mywust
  2. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java
  3. 5
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java

@ -1 +1 @@
Subproject commit 5fd50991814322760c7f4fb8b17a51ae8270e973
Subproject commit c13aa2f56f1ad3b1ab8475f1674f5851fa2f90da

@ -68,6 +68,8 @@ public class UndergradRpcException extends RpcException {
AUTH_USER_DISABLED,
// 用户账号需要更改
AUTH_NEED_CHANGE_PASSWORD,
// 专属选课时间段账号被禁用(--> _ -->)
AUTH_BANNED_IN_EXCLUSIVE_TIME,
AUTH_UNKNOWN_ERROR
}
}

@ -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;

Loading…
Cancel
Save