Merge pull request #108 from dderbentsov/UC-46

Ощистка полей при неверном логине или пароле
This commit is contained in:
frontgavrilin
2022-11-08 15:32:18 +03:00
committed by GitHub

View File

@@ -72,7 +72,6 @@ export default {
changeView() {
this.isView = !this.isView;
},
persist() {
localStorage.username = this.user.username;
localStorage.password = this.user.password;
@@ -88,7 +87,11 @@ export default {
if (result.status === 200) {
return result.json();
} else {
return (this.authorized = false);
this.authorized = false;
if (!this.authorized) {
this.user.username = "";
this.user.password = "";
}
}
})
.then((token) => {
@@ -101,7 +104,6 @@ export default {
});
},
},
mounted() {
if (localStorage.username) this.user.username = localStorage.username;
if (localStorage.password) this.user.password = localStorage.password;