Ощитска полей при неверном логине или пароле

This commit is contained in:
megavrilinvv
2022-11-08 15:31:26 +03:00
parent 110aa1bdb8
commit 0c7ec81a3a

View File

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