Revert "Add eslint-plugin-vue"

This reverts commit 6479b32063.
This commit is contained in:
KevinNThomas
2021-07-17 17:31:34 -07:00
parent 7548d4a19a
commit ca4c7804e0
11 changed files with 3389 additions and 4903 deletions

View File

@@ -21,44 +21,44 @@
<script>
export default {
data () {
data() {
return {
email: '',
password: ''
}
email: "",
password: "",
};
},
methods: {
handleSubmit (e) {
e.preventDefault()
handleSubmit(e) {
e.preventDefault();
if (this.password.length > 0) {
this.$http
.post('http://localhost:3000/login', {
.post("http://localhost:3000/login", {
email: this.email,
password: this.password
password: this.password,
})
.then((response) => {
const isAdmin = response.data.user.isAdmin
localStorage.setItem('user', JSON.stringify(response.data.user))
localStorage.setItem('jwt', response.data.token)
let is_admin = response.data.user.is_admin;
localStorage.setItem("user", JSON.stringify(response.data.user));
localStorage.setItem("jwt", response.data.token);
if (localStorage.getItem('jwt') != null) {
this.$emit('loggedIn')
if (localStorage.getItem("jwt") != null) {
this.$emit("loggedIn");
if (this.$route.params.nextUrl != null) {
this.$router.push(this.$route.params.nextUrl)
this.$router.push(this.$route.params.nextUrl);
} else {
if (isAdmin === 1) {
this.$router.push('admin')
if (is_admin == 1) {
this.$router.push("admin");
} else {
this.$router.push('dashboard')
this.$router.push("dashboard");
}
}
}
})
.catch(function (error) {
console.error(error.response)
})
console.error(error.response);
});
}
}
}
}
},
},
};
</script>