<template>

</template>

<script>
import { useUserStore } from '@/stores/user'

export default {
    mounted() {
        if (this.token) {
            localStorage.setItem('member_token', this.token)
            const userStore = useUserStore()
            userStore.setToken(this.token)
            setTimeout(() => {
                const target = this.target ? `/${this.target}` : '/Home'
                // console.log(target);

                this.$router.replace(target)
            }, 200)
        } else {
            this.$router.replace('/Home')
        }
    },
    data() {
        return {
            token: decodeURIComponent(this.$route.query.token || ''),
            target: decodeURIComponent(this.$route.query.target || ''),
        }
    },
    methods: {

    }
}
</script>