|
|
@@ -27,13 +27,16 @@ |
|
|
|
|
|
|
|
if (!this.$route.query.hasOwnProperty('session') || typeof session === 'undefined' || session === null) { |
|
|
|
console.warn('AppLoginPage.created: session parameter is empty, sending to login page'); |
|
|
|
this.$router.push('/login'); |
|
|
|
if (util.userLoggedIn()) { |
|
|
|
this.logout({messages: this.messages, errors: this.errors}); |
|
|
|
} |
|
|
|
this.$router.replace('/login'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.$route.query.hasOwnProperty('uri') || (typeof uri !== 'undefined' && uri !== null && uri.length > 0 && uri[0] !== '/')) { |
|
|
|
if (typeof uri !== 'undefined' && uri !== null && uri.length > 0 && uri[0] !== '/') { |
|
|
|
console.warn('AppLoginPage.created: uri parameter is not empty, sending to login page'); |
|
|
|
this.$router.push('/login'); |
|
|
|
this.$router.replace('/login'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@@ -45,15 +48,14 @@ |
|
|
|
if (uri.startsWith('/appLogin')) { |
|
|
|
uri = '/'; |
|
|
|
} |
|
|
|
this.user.token = session; |
|
|
|
this.setSessionUser(this.user); |
|
|
|
user.token = session; |
|
|
|
localStorage.setItem(util.USER_KEY, JSON.stringify(user)); |
|
|
|
this.checkSession({messages: this.messages, errors: this.errors}); |
|
|
|
this.$router.push({path: uri}); |
|
|
|
return; |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
...mapActions('account', ['login', 'logout', 'checkSession']), |
|
|
|
...mapActions('users', ['setSessionUser']), |
|
|
|
...mapActions('system', ['loadSystemConfigs', 'loadMessages']), |
|
|
|
} |
|
|
|
}; |