2025-04-07 15:42:09 +08:00
|
|
|
|
import {cookies} from 'next/headers'
|
2025-04-18 17:48:12 +08:00
|
|
|
|
import {Button} from '@/components/ui/button'
|
|
|
|
|
|
import {logout} from '@/actions/auth/auth'
|
2025-04-07 15:42:09 +08:00
|
|
|
|
|
|
|
|
|
|
export type ProfileProps = {}
|
|
|
|
|
|
|
|
|
|
|
|
export default async function Profile(props: ProfileProps) {
|
|
|
|
|
|
const store = await cookies()
|
|
|
|
|
|
const info = store.get('auth_info')?.value
|
|
|
|
|
|
const data = info ? JSON.parse(info) : undefined
|
|
|
|
|
|
return (
|
2025-04-18 17:48:12 +08:00
|
|
|
|
<div className="flex gap-2 items-center">
|
|
|
|
|
|
<span>下午好,{data?.payload.name}</span>
|
|
|
|
|
|
<Button theme={`error`} onClick={logout}>
|
|
|
|
|
|
退出登录
|
|
|
|
|
|
</Button>
|
2025-04-07 15:42:09 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|