完善认证功能,添加注销逻辑并优化用户界面
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {ReactNode} from 'react'
|
||||
import {cookies} from 'next/headers'
|
||||
import {Button} from '@/components/ui/button'
|
||||
import {logout} from '@/actions/auth/auth'
|
||||
|
||||
export type ProfileProps = {}
|
||||
|
||||
@@ -8,8 +9,11 @@ export default async function Profile(props: ProfileProps) {
|
||||
const info = store.get('auth_info')?.value
|
||||
const data = info ? JSON.parse(info) : undefined
|
||||
return (
|
||||
<div>
|
||||
下午好,{data?.payload.name}
|
||||
<div className="flex gap-2 items-center">
|
||||
<span>下午好,{data?.payload.name}</span>
|
||||
<Button theme={`error`} onClick={logout}>
|
||||
退出登录
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user