mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #459 from gradido/thx-page-dynamic
bug: Thx Page Shows Content Dependent of Route From
This commit is contained in:
commit
82e8963271
@ -84,7 +84,9 @@
|
||||
},
|
||||
"thx": {
|
||||
"title": "Danke!",
|
||||
"subtitle": "Wir haben dir eine eMail gesendet."
|
||||
"email": "Wir haben dir eine eMail gesendet.",
|
||||
"reset": "Dein Passwort wurde geändert.",
|
||||
"register": "Du bist jetzt regisriert."
|
||||
},
|
||||
"overview":{
|
||||
"account_overview":"Kontoübersicht",
|
||||
|
||||
@ -84,7 +84,9 @@
|
||||
},
|
||||
"thx": {
|
||||
"title": "Thank you!",
|
||||
"subtitle": "We have sent you an email."
|
||||
"email": "We have sent you an email.",
|
||||
"reset": "Your password has been changed.",
|
||||
"register": "You are registred now."
|
||||
},
|
||||
"overview":{
|
||||
"account_overview":"Account overview",
|
||||
|
||||
@ -47,8 +47,16 @@ 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.split('/')[1])) {
|
||||
next({ path: '/login' })
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/password',
|
||||
|
||||
@ -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,7 +107,13 @@ export default {
|
||||
const result = await loginAPI.changePassword(this.sessionId, this.email, this.password)
|
||||
if (result.success) {
|
||||
this.password = ''
|
||||
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)
|
||||
}
|
||||
|
||||
@ -5,12 +5,48 @@
|
||||
<b-container>
|
||||
<div class="header-body text-center mb-7">
|
||||
<p class="h1">{{ $t('site.thx.title') }}</p>
|
||||
<p class="h4">{{ $t('site.thx.subtitle') }}</p>
|
||||
<p class="h4">{{ $t(displaySetup.subtitle) }}</p>
|
||||
<hr />
|
||||
<b-button to="/login">{{ $t('login') }}</b-button>
|
||||
<b-button :to="displaySetup.linkTo">{{ $t(displaySetup.button) }}</b-button>
|
||||
</div>
|
||||
</b-container>
|
||||
</div>
|
||||
<!-- Page content -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
const textFields = {
|
||||
password: {
|
||||
subtitle: 'site.thx.email',
|
||||
button: 'login',
|
||||
linkTo: '/login',
|
||||
},
|
||||
reset: {
|
||||
subtitle: 'site.thx.reset',
|
||||
button: 'login',
|
||||
linkTo: '/login',
|
||||
},
|
||||
register: {
|
||||
subtitle: 'site.thx.register',
|
||||
button: 'site.login.signin',
|
||||
linkTo: '/overview',
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Thx',
|
||||
data() {
|
||||
return {
|
||||
displaySetup: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setDisplaySetup(from) {
|
||||
this.displaySetup = textFields[this.$route.params.comingFrom]
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.setDisplaySetup()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user