<template>

</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { qrcodeLogin } from '/@/api/backend'
import { useAdminInfo } from '/@/stores/adminInfo'
import { ElNotification } from 'element-plus'

const router = useRouter()

const querys = router.currentRoute.value.query
const adminInfo = useAdminInfo()

qrcodeLogin(querys)
    .then((res) => {
        adminInfo.$state = res.data.userinfo
        ElNotification({
            message: res.msg,
            type: 'success',
        })
        router.push({ name: res.data.routeName })
    })
    .catch(() => {
        router.go(-1)
    })
</script>

<style scoped>
</style>
