mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
thx pages works without errors
This commit is contained in:
parent
f620171754
commit
77ec087775
@ -47,11 +47,11 @@ const routes = [
|
||||
component: () => import('../views/Pages/Login.vue'),
|
||||
},
|
||||
{
|
||||
path: '/thx',
|
||||
path: '/thx/:comingFrom',
|
||||
component: () => import('../views/Pages/thx.vue'),
|
||||
beforeEnter: (to, from, next) => {
|
||||
const validFrom = ['/password', '/reset', '/register']
|
||||
if (!validFrom.includes(from.path)) {
|
||||
const validFrom = ['password', 'reset', 'register']
|
||||
if (!validFrom.includes(from.path.split('/')[1])) {
|
||||
next({ path: '/login' })
|
||||
} else {
|
||||
next()
|
||||
|
||||
@ -62,7 +62,7 @@ export default {
|
||||
async onSubmit() {
|
||||
const result = await loginAPI.sendEmail(this.form.email)
|
||||
if (result.success) {
|
||||
this.$router.push({ path: '/thx', params: { id: 'resetmail' } })
|
||||
this.$router.push('/thx/password')
|
||||
} else {
|
||||
alert(result.result)
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ export default {
|
||||
this.model.firstname = ''
|
||||
this.model.lastname = ''
|
||||
this.password = ''
|
||||
this.$router.push('/thx')
|
||||
this.$router.push('/thx/register')
|
||||
} else {
|
||||
this.showError = true
|
||||
this.messageError = result.result.message
|
||||
|
||||
@ -107,11 +107,13 @@ export default {
|
||||
const result = await loginAPI.changePassword(this.sessionId, this.email, this.password)
|
||||
if (result.success) {
|
||||
this.password = ''
|
||||
this.$store.dispatch('login', {
|
||||
sessionId: result.result.data.session_id,
|
||||
email: result.result.data.user.email,
|
||||
})
|
||||
this.$router.push('/thx')
|
||||
/*
|
||||
this.$store.dispatch('login', {
|
||||
sessionId: result.result.data.session_id,
|
||||
email: result.result.data.user.email,
|
||||
})
|
||||
*/
|
||||
this.$router.push('/thx/reset')
|
||||
} else {
|
||||
alert(result.result.message)
|
||||
}
|
||||
|
||||
@ -16,17 +16,17 @@
|
||||
</template>
|
||||
<script>
|
||||
const textFields = {
|
||||
'/password': {
|
||||
password: {
|
||||
subtitle: 'site.thx.email',
|
||||
button: 'login',
|
||||
linkTo: '/login',
|
||||
},
|
||||
'/reset': {
|
||||
reset: {
|
||||
subtitle: 'site.thx.reset',
|
||||
button: 'site.login.signin',
|
||||
linkTo: '/overview',
|
||||
button: 'login',
|
||||
linkTo: '/login',
|
||||
},
|
||||
'/register': {
|
||||
register: {
|
||||
subtitle: 'site.thx.register',
|
||||
button: 'site.login.signin',
|
||||
linkTo: '/overview',
|
||||
@ -37,22 +37,16 @@ export default {
|
||||
name: 'Thx',
|
||||
data() {
|
||||
return {
|
||||
comingFrom: null,
|
||||
displaySetup: {},
|
||||
}
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next((vm) => {
|
||||
vm.comingFrom = from.path
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
setupDisplay() {
|
||||
this.displaySetup = textFields[this.comingFrom]
|
||||
setDisplaySetup(from) {
|
||||
this.displaySetup = textFields[this.$route.params.comingFrom]
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.setupDisplay()
|
||||
this.setDisplaySetup()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user