From 048ee5833ee91be0d9201d5e8c5a042503ec1825 Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Wed, 28 Jan 2026 18:44:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=BC=95=E7=94=A8=E4=BB=8E=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=94=B9=E4=B8=BAwindow=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免在未正确初始化antdv-next时使用notification导致运行时错误 --- apps/web-antd/src/store/auth.ts | 3 +-- apps/web-antd/src/store/notify.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/web-antd/src/store/auth.ts b/apps/web-antd/src/store/auth.ts index 0ac5a3fc..98eff078 100644 --- a/apps/web-antd/src/store/auth.ts +++ b/apps/web-antd/src/store/auth.ts @@ -8,7 +8,6 @@ import { LOGIN_PATH } from '@vben/constants'; import { preferences } from '@vben/preferences'; import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores'; -import { notification } from 'antdv-next'; import { defineStore } from 'pinia'; import { doLogout, getUserInfoApi, loginApi, seeConnectionClose } from '#/api'; @@ -66,7 +65,7 @@ export const useAuthStore = defineStore('auth', () => { } if (userInfo?.realName) { - notification.success({ + window.notification.success({ description: `${$t('authentication.loginSuccessDesc')}:${userInfo?.realName}`, duration: 3, title: $t('authentication.loginSuccess'), diff --git a/apps/web-antd/src/store/notify.ts b/apps/web-antd/src/store/notify.ts index 2a5460a5..ce770246 100644 --- a/apps/web-antd/src/store/notify.ts +++ b/apps/web-antd/src/store/notify.ts @@ -7,7 +7,6 @@ import { $t } from '@vben/locales'; import { useUserStore } from '@vben/stores'; import { buildUUID } from '@vben/utils'; -import { notification } from 'antdv-next'; import dayjs from 'dayjs'; import { defineStore } from 'pinia'; @@ -53,7 +52,7 @@ export const useNotifyStore = defineStore( if (!message) return; console.log(`接收到消息: ${message}`); - notification.success({ + window.notification.success({ description: message, duration: 3, title: $t('component.notice.received'),