fix: 修复通知组件引用从直接导入改为window对象

避免在未正确初始化antdv-next时使用notification导致运行时错误
This commit is contained in:
dap
2026-01-28 18:44:06 +08:00
parent 3cb93fd67c
commit 048ee5833e
2 changed files with 2 additions and 4 deletions

View File

@@ -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'),

View File

@@ -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'),