mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-04-09 09:23:15 +08:00
fix: 修复通知组件引用从直接导入改为window对象
避免在未正确初始化antdv-next时使用notification导致运行时错误
This commit is contained in:
@@ -8,7 +8,6 @@ import { LOGIN_PATH } from '@vben/constants';
|
|||||||
import { preferences } from '@vben/preferences';
|
import { preferences } from '@vben/preferences';
|
||||||
import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
|
import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
|
||||||
|
|
||||||
import { notification } from 'antdv-next';
|
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
|
||||||
import { doLogout, getUserInfoApi, loginApi, seeConnectionClose } from '#/api';
|
import { doLogout, getUserInfoApi, loginApi, seeConnectionClose } from '#/api';
|
||||||
@@ -66,7 +65,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userInfo?.realName) {
|
if (userInfo?.realName) {
|
||||||
notification.success({
|
window.notification.success({
|
||||||
description: `${$t('authentication.loginSuccessDesc')}:${userInfo?.realName}`,
|
description: `${$t('authentication.loginSuccessDesc')}:${userInfo?.realName}`,
|
||||||
duration: 3,
|
duration: 3,
|
||||||
title: $t('authentication.loginSuccess'),
|
title: $t('authentication.loginSuccess'),
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import { $t } from '@vben/locales';
|
|||||||
import { useUserStore } from '@vben/stores';
|
import { useUserStore } from '@vben/stores';
|
||||||
import { buildUUID } from '@vben/utils';
|
import { buildUUID } from '@vben/utils';
|
||||||
|
|
||||||
import { notification } from 'antdv-next';
|
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@ export const useNotifyStore = defineStore(
|
|||||||
if (!message) return;
|
if (!message) return;
|
||||||
console.log(`接收到消息: ${message}`);
|
console.log(`接收到消息: ${message}`);
|
||||||
|
|
||||||
notification.success({
|
window.notification.success({
|
||||||
description: message,
|
description: message,
|
||||||
duration: 3,
|
duration: 3,
|
||||||
title: $t('component.notice.received'),
|
title: $t('component.notice.received'),
|
||||||
|
|||||||
Reference in New Issue
Block a user