feat: 主动收邮件
parent
c52db468d3
commit
09125b32ac
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 7.23792L12.0718 14.338L4 7.21594V19H13V21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V12H20V7.23792ZM19.501 5H4.51146L12.0619 11.662L19.501 5ZM20 18H23L19 22L15 18H18V14H20V18Z"></path></svg>
|
After Width: | Height: | Size: 323 B |
@ -0,0 +1,30 @@
|
||||
import { createContext, useEffect, useState } from 'react'
|
||||
import { App, Tooltip, Button } from 'antd'
|
||||
import { PlusOutlined, LoadingOutlined, HistoryOutlined, FireOutlined, AudioTwoTone } from '@ant-design/icons'
|
||||
import { getEmailFetchAction, getAllEmailFetchAction } from '@/actions/EmailActions'
|
||||
import useAuthStore from '@/stores/AuthStore'
|
||||
import { MailDownloadIcon } from '@/components/Icons'
|
||||
|
||||
const EmailFetch = ({ ...props }) => {
|
||||
const { message } = App.useApp()
|
||||
const { userId, emailList } = useAuthStore((state) => state.loginUser)
|
||||
const [getEmailLoading, setEmailLoading] = useState(false)
|
||||
const [fetchingText, setFetchingText] = useState('收邮件')
|
||||
const handleGetEmail = async () => {
|
||||
setEmailLoading(true)
|
||||
// const ret = await getEmailFetchAction({ ...{}, opi_sn: userId })
|
||||
const ret = await getAllEmailFetchAction(emailList)
|
||||
// setFetchingText('正在接收邮件...');
|
||||
setEmailLoading(false)
|
||||
message.info('正在接收邮件...') // .info
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip key={'email-fetch'} title={fetchingText}>
|
||||
<Button type='text' onClick={handleGetEmail} icon={getEmailLoading ? <LoadingOutlined className='text-indigo-500' /> : <MailDownloadIcon className='text-indigo-500' />} />
|
||||
</Tooltip>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default EmailFetch
|
Loading…
Reference in New Issue