修复使用用户名登录时无法修改密码的问题

liwentao_branch
Teptao 4 months ago
parent 62fd382179
commit fa39f48a34

@ -0,0 +1,15 @@
<component name="ArtifactManager">
<artifact type="jar" name="TestSystem:jar">
<output-path>$PROJECT_DIR$/out/artifacts/TestSystem_jar</output-path>
<root id="archive" name="TestSystem.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/META-INF/MANIFEST.MF" />
</element>
<element id="module-output" name="TestSystem" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/net/objecthunter/exp4j/0.4.8/exp4j-0.4.8.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/sun/mail/jakarta.mail/2.0.1/jakarta.mail-2.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/formdev/flatlaf/3.4.1/flatlaf-3.4.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/sun/activation/jakarta.activation/2.0.1/jakarta.activation-2.0.1.jar" path-in-jar="/" />
</root>
</artifact>
</component>

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="TestSystem:jar" />
</artifacts-to-build>
</component>
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="1201acd7-f240-4a23-9c12-26bf9afcb8cb" name="更改" comment="合并更改">
<change afterPath="$PROJECT_DIR$/.idea/artifacts/TestSystem_jar.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data/users.txt" beforeDir="false" afterPath="$PROJECT_DIR$/data/users.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/mathapp/panels/LoginPanel.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/mathapp/panels/LoginPanel.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/mathapp/services/DataPersistence.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/mathapp/services/DataPersistence.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/mathapp/panels/LoginPanel.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/mathapp/panels/LoginPanel.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/com/mathapp/services/DataPersistence.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/mathapp/services/DataPersistence.class" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -40,11 +42,15 @@
</favorite-branches>
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="liwentao_branch" />
<entry key="$PROJECT_DIR$" value="main" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="KubernetesApiPersistence"><![CDATA[{}]]></component>
<component name="KubernetesApiProvider"><![CDATA[{
"isMigrated": true
}]]></component>
<component name="ProjectColorInfo">{
&quot;customColor&quot;: &quot;&quot;,
&quot;associatedIndex&quot;: 1
@ -58,6 +64,7 @@
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"git-widget-placeholder": "liwentao__branch",
"kotlin-language-version-configured": "true",
"node.js.detected.package.eslint": "true",
@ -66,7 +73,7 @@
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"onboarding.tips.debug.path": "C:/Users/Teptao/Desktop/软件工程导论/结对项目/TestSystem/src/main/java/org/example/Main.java",
"project.structure.last.edited": "模块",
"project.structure.last.edited": "工件",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.2",
"vue.rearranger.settings.migration": "true",
@ -90,6 +97,8 @@
<recent_temporary>
<list>
<item itemvalue="应用程序.MathApp" />
<item itemvalue="应用程序.MathApp" />
<item itemvalue="应用程序.MathApp" />
</list>
</recent_temporary>
</component>

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

@ -82,7 +82,7 @@ public class DataPersistence {
List<String> 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);

Loading…
Cancel
Save