<template>
    <div>
        <h2>客户首页</h2>
        <p>当前时间：{{ new Date().toLocaleString() }}</p>
        <div class="mt-4">
            <el-button type="danger" @click="logout">注销退出</el-button>
        </div>
    </div>
</template>

<script setup>
    import { useRouter } from 'vue-router'
    import { useUserStore } from '@/store'
    import { removeToken } from '@/utils'

    const router = useRouter()
    const userStore = useUserStore()

    const logout = () => {
        userStore.logout()
        removeToken()
        router.push('/login')
    }
</script>

<style lang="scss" scoped>

</style>