diff --git a/apps/web-antd/src/locales/langs/en-US.json b/apps/web-antd/src/locales/langs/en-US.json index 0d48e65f..5e75419a 100644 --- a/apps/web-antd/src/locales/langs/en-US.json +++ b/apps/web-antd/src/locales/langs/en-US.json @@ -25,6 +25,10 @@ "placeholder": "Please select a tenant", "switch": "Switch to tenant: ", "reset": "Reset to default tenant" + }, + "notice": { + "title": "Notice", + "received": "You have received a new message" } }, "pages": { diff --git a/apps/web-antd/src/locales/langs/zh-CN.json b/apps/web-antd/src/locales/langs/zh-CN.json index 7af13fb6..78207486 100644 --- a/apps/web-antd/src/locales/langs/zh-CN.json +++ b/apps/web-antd/src/locales/langs/zh-CN.json @@ -25,6 +25,10 @@ "placeholder": "选择租户", "switch": "切换当前租户为: ", "reset": "还原为默认租户" + }, + "notice": { + "title": "消息", + "received": "收到新消息" } }, "pages": { diff --git a/apps/web-antd/src/store/notify.ts b/apps/web-antd/src/store/notify.ts index cb91c634..d43f0aac 100644 --- a/apps/web-antd/src/store/notify.ts +++ b/apps/web-antd/src/store/notify.ts @@ -3,6 +3,7 @@ import type { NotificationItem } from '@vben/layouts'; import { computed, ref, watch } from 'vue'; import { useAppConfig } from '@vben/hooks'; +import { $t } from '@vben/locales'; import { useAccessStore, useUserStore } from '@vben/stores'; import { useEventSource } from '@vueuse/core'; @@ -48,7 +49,7 @@ export const useNotifyStore = defineStore( autoReconnect: { delay: 1000, onFailed() { - console.log('sse重连失败.'); + console.error('sse重连失败.'); }, retries: 3, }, @@ -61,7 +62,7 @@ export const useNotifyStore = defineStore( notification.success({ description: message, duration: 3, - message: '收到新消息', + message: $t('component.notice.received'), }); notificationList.value.unshift({ @@ -70,7 +71,7 @@ export const useNotifyStore = defineStore( date: dayjs().format('YYYY-MM-DD HH:mm:ss'), isRead: false, message, - title: '消息', + title: $t('component.notice.title'), userId: userId.value, });