mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-16 04:58:02 +00:00
Add sample support, re-organize repo
This commit is contained in:
29
src/components/login.js
Normal file
29
src/components/login.js
Normal file
@@ -0,0 +1,29 @@
|
||||
export default {
|
||||
data: () => ({
|
||||
valid: false,
|
||||
username: '',
|
||||
password: '',
|
||||
usernameRules: [
|
||||
v => !!v || 'Username is required'
|
||||
],
|
||||
passwordRules: [
|
||||
v => !!v || 'Password is required'
|
||||
]
|
||||
}),
|
||||
methods: {
|
||||
login () {
|
||||
this.$http.post('/login/password', {
|
||||
username: this.username,
|
||||
password: this.password
|
||||
})
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
this.$router.push('/')
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error.response)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user