mirror of
https://github.com/kaythomas0/noisedash.git
synced 2025-11-15 20:48:03 +00:00
Add sample support, re-organize repo
This commit is contained in:
31
src/components/register.js
Normal file
31
src/components/register.js
Normal file
@@ -0,0 +1,31 @@
|
||||
export default {
|
||||
data: () => ({
|
||||
valid: false,
|
||||
name: '',
|
||||
username: '',
|
||||
password: '',
|
||||
rules: {
|
||||
required: v => !!v || 'Required'
|
||||
}
|
||||
}),
|
||||
methods: {
|
||||
register () {
|
||||
this.$http.post('/users', {
|
||||
name: this.name,
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
isAdmin: 1,
|
||||
darkMode: 0,
|
||||
canUpload: 1
|
||||
})
|
||||
.then(response => {
|
||||
if (response.status === 200) {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error.response)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user