Skip to content

Commit

Permalink
Bug fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
RedDragon0293 committed Apr 16, 2024
1 parent b736153 commit 16092bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/cn/reddragon/eportal/Authenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Authenticator {
public static final String ePortalUrl = "http://10.96.0.155/eportal/InterFace.do?method=";
public static String userIndex = null;
public static boolean online = false;
public static LoginType type;
public static LoginType type = null;
public static boolean error = false;

public static HttpURLConnection login(String username, String password, String service, String queryString) {
Expand Down Expand Up @@ -150,6 +150,8 @@ public static void updateStatus() {
if (online) {
updateUserIndex();
updateSession();
} else {
Authenticator.type = null;
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/cn/reddragon/eportal/HelloController.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public void updateUI() {
if (Authenticator.online) {
button.setText("Logout");
sb.append("Online ");
if (Authenticator.type == null) {
sb.append("(...)");
} else
for (LoginType it : LoginType.values()) {
if (Objects.equals(it, Authenticator.type)) {
sb.append('(');
Expand Down

0 comments on commit 16092bb

Please sign in to comment.