diff --git a/.idea/artifacts/TestSystem_jar.xml b/.idea/artifacts/TestSystem_jar.xml new file mode 100644 index 0000000..9749be4 --- /dev/null +++ b/.idea/artifacts/TestSystem_jar.xml @@ -0,0 +1,15 @@ + + + $PROJECT_DIR$/out/artifacts/TestSystem_jar + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index d14cfa1..6eb2a49 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,16 +1,18 @@ + + + + + + - - - - + + { "customColor": "", "associatedIndex": 1 @@ -58,6 +64,7 @@ + + diff --git a/data/users.txt b/data/users.txt index 2598ee0..e102e26 100644 --- a/data/users.txt +++ b/data/users.txt @@ -1,4 +1,4 @@ test@example.com::jZae727K08KaOmKSgOaGzww/XVqLqBG7KAbpTTJzaI0= -Tester::1650163832@qq.com::7RcqFZEiXA1x7ggr5Sy2xvdMuJb6Xz/P8aMMmj+PZbI= +Tester::Tester::7RcqFZEiXA1x7ggr5Sy2xvdMuJb6Xz/P8aMMmj+PZbI= Tester2::1414246561@qq.com::7RcqFZEiXA1x7ggr5Sy2xvdMuJb6Xz/P8aMMmj+PZbI= diff --git a/src/main/java/com/mathapp/services/DataPersistence.java b/src/main/java/com/mathapp/services/DataPersistence.java index 44276ec..bd06bc1 100644 --- a/src/main/java/com/mathapp/services/DataPersistence.java +++ b/src/main/java/com/mathapp/services/DataPersistence.java @@ -82,7 +82,7 @@ public class DataPersistence { List lines = Files.readAllLines(USER_FILE_PATH, StandardCharsets.UTF_8); for (int i = 0; i < lines.size(); i++) { String[] parts = lines.get(i).split("::"); - if (parts.length >= 3 && parts[1].equals(email)) { + if (parts.length >= 3 && parts[1].equals(email) || parts[0].equals(email)) { User tempUser = new User(parts[0], email, newPassword); lines.set(i, parts[0] + "::" + email + "::" + tempUser.getHashedPassword()); Files.write(USER_FILE_PATH, lines, StandardCharsets.UTF_8); diff --git a/target/classes/com/mathapp/services/DataPersistence.class b/target/classes/com/mathapp/services/DataPersistence.class index 833b4a9..381c2c5 100644 Binary files a/target/classes/com/mathapp/services/DataPersistence.class and b/target/classes/com/mathapp/services/DataPersistence.class differ