clean password recovery
This commit is contained in:
@@ -1,22 +1,23 @@
|
|||||||
<template lang="pug">
|
<template lang='pug'>
|
||||||
el-dialog(:visible='true' @close="$router.push('/')" :close-on-click-modal='false')
|
el-card.mt-5
|
||||||
template(slot='title')
|
h4(slot='header')
|
||||||
h4 <nuxt-link to='/'><img src='/favicon.ico'/></nuxt-link> {{$t('common.recover_password')}}
|
nuxt-link(to='/')
|
||||||
|
img(src='/favicon.ico')
|
||||||
|
span {{settings.title}} - {{$t('common.authorize')}}
|
||||||
div(v-if='valid')
|
div(v-if='valid')
|
||||||
el-input(type='password', :placeholder='$t("common.new_password")' v-model='new_password' prefix-icon='el-icon-lock')
|
el-input(type='password', :placeholder='$t("common.new_password")' v-model='new_password' prefix-icon='el-icon-lock')
|
||||||
div(v-else) {{$t('recover.not_valid_code')}}
|
div(v-else) {{$t('recover.not_valid_code')}}
|
||||||
|
|
||||||
template(v-if='valid' slot='footer')
|
el-button.mt-2(plain v-if='valid' type="success" icon='el-icon-check'
|
||||||
el-button(plain type="success" icon='el-icon-send', @click='change_password') {{$t('common.send')}}
|
@click='change_password') {{$t('common.send')}}
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { Message } from 'element-ui'
|
import { Message } from 'element-ui'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Recover',
|
name: 'Recover',
|
||||||
data () {
|
layout: 'modal',
|
||||||
return { new_password: '' }
|
|
||||||
},
|
|
||||||
async asyncData ({ params, $axios }) {
|
async asyncData ({ params, $axios }) {
|
||||||
const code = params.code
|
const code = params.code
|
||||||
try {
|
try {
|
||||||
@@ -26,6 +27,10 @@ export default {
|
|||||||
return { valid: false }
|
return { valid: false }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data () {
|
||||||
|
return { new_password: '' }
|
||||||
|
},
|
||||||
|
computed: mapState(['settings']),
|
||||||
methods: {
|
methods: {
|
||||||
async change_password () {
|
async change_password () {
|
||||||
try {
|
try {
|
||||||
@@ -44,6 +49,17 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
head () {
|
||||||
|
return { title: `${this.settings.title} - Authorize` }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang='less'>
|
||||||
|
h4 img {
|
||||||
|
max-height: 40px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: #333;
|
||||||
|
border: 1px solid #333;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user