refactoring email notification, closes #8

This commit is contained in:
les
2019-09-06 11:58:11 +02:00
parent 2c24591621
commit beebca7ab9
31 changed files with 195 additions and 149 deletions

View File

@@ -5,7 +5,7 @@
el-button(circle icon='el-icon-close' type='danger' size='small' plain)
h5 {{$t('common.register')}}
el-form(@submit.native.prevent='register' method='POST' action='/api/user/register')
el-form(@submit.native.prevent='register' method='POST' action='')
p(v-html="$t('register.description')")
el-input.mb-2(v-model='user.username' type='text' name='username'
@@ -23,7 +23,7 @@
v-icon(name='envelope-open-text')
el-button(plain type="success" native-type='submit'
:disabled='disabled') {{$t('common.send')}} <v-icon name='chevron-right'/>
:disabled='disabled') {{$t('common.send')}} <v-icon :name='loading?"circle-notch":"chevron-right"' :spin='loading'/>
</template>
<script>
@@ -35,8 +35,8 @@ export default {
name: 'Register',
data () {
return {
error: {},
user: { }
loading: false,
user: {}
}
},
head () {
@@ -57,6 +57,7 @@ export default {
methods: {
...mapActions(['login']),
async register () {
this.loading = true
try {
const { user } = await this.$axios.$post('/user/register', this.user)
Message({
@@ -73,6 +74,7 @@ export default {
type: 'error'
})
}
this.loading = false
}
}
}