perf: 系统更新按钮

main
Lei OT 5 months ago
parent e4f32163fb
commit 519ebc26c8

@ -113,6 +113,7 @@
"Paid": "Paid"
},
"Compare": "Compare",
"SystemUpdate": "System Update",
"review": {
"ReviewLink": "Review Link",
"DatePosted": "Date Posted",

@ -111,5 +111,6 @@
"Finance_Dept_arrproved": "财务已审核",
"Paid": "已打款"
},
"Compare": "对比"
"Compare": "对比",
"SystemUpdate": "系统更新"
}

@ -136,6 +136,8 @@ function App() {
isPermitted(PERM_ACCOUNT_MANAGEMENT) ? { label: <Link to='/account/management'>{t('account:accountList')}</Link>, key: '3' } : null,
isPermitted(PERM_ROLE_NEW) ? { label: <Link to='/account/role-list'>{t('account:roleList')}</Link>, key: '4' } : null,
{ type: 'divider' },
{ label: <ReloadUpdate type='link' className='px-0' />, key: '5' },
{ type: 'divider' },
{ label: <Link to='/logout'>{t('Logout')}</Link>, key: '99' },
]
],

@ -1,14 +1,17 @@
import { Button } from 'antd';
import { clearAllCaches } from '@/utils/commons';
import { useTranslation } from 'react-i18next'
const ReloadUpdate = ({ ...props }) => {
const { t } = useTranslation()
const forceReload = async () => {
await clearAllCaches();
window.location.reload(true);
};
return (
<Button type='default' onClick={forceReload} className='ms-2'>
🔃🚀
<Button type={'link'} onClick={forceReload} className={`ms-2 `} {...props}>
{t('SystemUpdate')} 🚀
</Button>
);
};

Loading…
Cancel
Save