Avoid /login and /signup page when logged
This commit is contained in:
parent
23d004489d
commit
b4ecd14432
|
@ -142,6 +142,11 @@ export default {
|
|||
},
|
||||
|
||||
watch: {
|
||||
user_isLogged: function (isLogged) {
|
||||
if (isLogged && (this.$route.name === 'login' || this.$route.name === 'signup')) {
|
||||
this.$router.replace('/')
|
||||
}
|
||||
},
|
||||
user_getSettings: function (settings) {
|
||||
if (settings && settings.language && this.$i18n.locale !== settings.language) {
|
||||
this.$i18n.locale = settings.language
|
||||
|
|
|
@ -101,6 +101,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
|
||||
data: function () {
|
||||
|
@ -109,6 +111,16 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapGetters('user', ['user_isLogged'])
|
||||
},
|
||||
|
||||
mounted () {
|
||||
if (this.user_isLogged) {
|
||||
this.$router.replace('/')
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
testlogin () {
|
||||
const valid = this.$refs.form.checkValidity()
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import UserApi from '@/api/user'
|
||||
import PasswordChecks from '@/mixins/passwordChecks'
|
||||
|
||||
|
@ -156,6 +157,13 @@ export default {
|
|||
return null
|
||||
}
|
||||
return /.+@.+\..+/i.test(this.signupForm.email)
|
||||
},
|
||||
...mapGetters('user', ['user_isLogged'])
|
||||
},
|
||||
|
||||
mounted () {
|
||||
if (this.user_isLogged) {
|
||||
this.$router.replace('/')
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user