Add eslint-plugin-vue

This commit is contained in:
KevinNThomas
2021-07-17 15:57:05 -07:00
parent 1871ea9eb7
commit 6479b32063
11 changed files with 4908 additions and 3394 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) => {
let is_admin = response.data.user.is_admin;
localStorage.setItem("user", JSON.stringify(response.data.user));
localStorage.setItem("jwt", response.data.token);
const isAdmin = response.data.user.isAdmin
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 (is_admin == 1) {
this.$router.push("admin");
if (isAdmin === 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>