feat: 完成 useStorage
parent
3235e7e574
commit
e31a20e92d
@ -0,0 +1,31 @@
|
||||
import { Flex, Result, Spin } from 'antd'
|
||||
import { useEffect } from 'react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import useAuthStore from '@/stores/Auth'
|
||||
|
||||
function Logout() {
|
||||
|
||||
const navigate = useNavigate()
|
||||
|
||||
const logout = useAuthStore(state => state.logout)
|
||||
|
||||
useEffect(() => {
|
||||
logout()
|
||||
navigate('/login')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Flex justify='center' align='center' gap='middle' vertical>
|
||||
<Result
|
||||
status='success'
|
||||
title='退出成功'
|
||||
subTitle='正在跳转登陆页面'
|
||||
extra={[
|
||||
<Spin key='small-span' size='small' />
|
||||
]}
|
||||
/>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
export default Logout
|
Loading…
Reference in New Issue