diff --git a/packages/core/client/src/locale/zh-CN.json b/packages/core/client/src/locale/zh-CN.json index 9af89a3b5ce..4385002bd09 100644 --- a/packages/core/client/src/locale/zh-CN.json +++ b/packages/core/client/src/locale/zh-CN.json @@ -838,6 +838,7 @@ "The will interrupt service, it may take a few seconds to restart. Are you sure to continue?": "重启将会中断当前服务,这个过程可能需要一点时间,确定要继续吗?", "Restart": "重启", "Clear cache": "清除缓存", + "Are you sure you want to clear cache ?": "你确定你想清除缓存吗", "Duplicate": "复制", "Duplicating": "复制中", "Duplicate mode": "复制方式", diff --git a/packages/plugins/@nocobase/plugin-client/src/client/ClearCache.tsx b/packages/plugins/@nocobase/plugin-client/src/client/ClearCache.tsx index 08c768e075d..1f8e9162881 100644 --- a/packages/plugins/@nocobase/plugin-client/src/client/ClearCache.tsx +++ b/packages/plugins/@nocobase/plugin-client/src/client/ClearCache.tsx @@ -10,17 +10,29 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { useAPIClient, SchemaSettingsItem } from '@nocobase/client'; +import { App } from 'antd'; export const ClearCache = () => { const { t } = useTranslation(); const api = useAPIClient(); + const { modal } = App.useApp(); return ( { - await api.resource('app').clearCache(); - window.location.reload(); + modal.confirm({ + title: t('Clear cache'), + content: t('Are you sure you want to clear cache ?'), + okText: t('Clear'), + okButtonProps: { + danger: true, + }, + onOk: async () => { + await api.resource('app').clearCache(); + window.location.reload(); + }, + }); }} > {t('Clear cache')}