Merge branch 'main' into vue3
This commit is contained in:
@ -163,6 +163,9 @@ export default {
|
||||
// object passed to this function here still has a reference to the store.
|
||||
this.labelEditLabel = new LabelModel({
|
||||
...label,
|
||||
// The model does not support passing dates into it directly so we need to convert them first
|
||||
created: +label.created,
|
||||
updated: +label.updated,
|
||||
})
|
||||
this.isLabelEdit = true
|
||||
|
||||
|
@ -104,13 +104,13 @@
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
import router from '../../router'
|
||||
import {HTTPFactory} from '@/http-common'
|
||||
import {ERROR_MESSAGE, LOADING} from '@/store/mutation-types'
|
||||
import legal from '../../components/misc/legal'
|
||||
import ApiConfig from '@/components/misc/api-config.vue'
|
||||
import {getErrorText} from '@/message'
|
||||
import {redirectToProvider} from '../../helpers/redirectToProvider'
|
||||
import {getLastVisited, clearLastVisited} from '../../helpers/saveLastVisited'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -142,9 +142,18 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
// Check if the user is already logged in, if so, redirect him to the homepage
|
||||
// Check if the user is already logged in, if so, redirect them to the homepage
|
||||
if (this.authenticated) {
|
||||
router.push({name: 'home'})
|
||||
const last = getLastVisited()
|
||||
if (last !== null) {
|
||||
this.$router.push({
|
||||
name: last.name,
|
||||
params: last.params,
|
||||
})
|
||||
clearLastVisited()
|
||||
} else {
|
||||
this.$router.push({name: 'home'})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -14,6 +14,7 @@ import {mapState} from 'vuex'
|
||||
|
||||
import {ERROR_MESSAGE, LOADING} from '@/store/mutation-types'
|
||||
import {getErrorText} from '@/message'
|
||||
import {clearLastVisited, getLastVisited} from '../../helpers/saveLastVisited'
|
||||
|
||||
export default {
|
||||
name: 'Auth',
|
||||
@ -63,7 +64,16 @@ export default {
|
||||
code: this.$route.query.code,
|
||||
})
|
||||
.then(() => {
|
||||
this.$router.push({name: 'home'})
|
||||
const last = getLastVisited()
|
||||
if (last !== null) {
|
||||
this.$router.push({
|
||||
name: last.name,
|
||||
params: last.params,
|
||||
})
|
||||
clearLastVisited()
|
||||
} else {
|
||||
this.$router.push({name: 'home'})
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
const err = getErrorText(e)
|
||||
|
@ -116,7 +116,7 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
// Check if the user is already logged in, if so, redirect him to the homepage
|
||||
// Check if the user is already logged in, if so, redirect them to the homepage
|
||||
if (this.authenticated) {
|
||||
router.push({name: 'home'})
|
||||
}
|
||||
|
Reference in New Issue
Block a user