chore: i18n

This commit is contained in:
dap 2024-09-10 09:05:16 +08:00
parent 29d1e38843
commit 0a4388b05a
3 changed files with 12 additions and 3 deletions

View File

@ -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": {

View File

@ -25,6 +25,10 @@
"placeholder": "选择租户",
"switch": "切换当前租户为: ",
"reset": "还原为默认租户"
},
"notice": {
"title": "消息",
"received": "收到新消息"
}
},
"pages": {

View File

@ -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,
});