You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Global-sales/src/views/ClearCache.jsx

23 lines
675 B
JavaScript

import { createContext, useContext, useEffect, useState } from 'react';
import { App } from 'antd';
import { calcCacheSizes, clearAllCaches } from '@/utils/commons';
const ClearCache = (props) => {
const { message } = App.useApp();
// useEffect(() => {
// const cacheSizeInfo = calcCacheSizes();
// }, []);
const clearAllCachesA = async () => {
await clearAllCaches(message.success(`清除成功🎉`));
}
return (
<>
<a onClick={clearAllCachesA}>
清除缓存{/* &nbsp;{cacheSizeInfo.totalSize > 0 && <span>{formatBytes(cacheSizeInfo.totalSize)}</span>} */}
</a>
</>
);
};
export default ClearCache;