mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
feat: 更新依赖项和配置,添加新通知类型
- 在 package.json 中添加了 @types/md5 和 @vueuse/integrations 依赖。 - 更新了 tsconfig.json 中的模块解析方式为 bundler。 - 在组件声明中移除了不再使用的 Naive UI 组件。 - 在弹幕窗口和设置中添加了启用动画的选项,并更新了相关样式。 - 实现了私信发送失败的通知功能,增强了用户体验。
This commit is contained in:
@@ -85,4 +85,22 @@ export function onGoodsBuy(info: {
|
||||
extra: { type: 'goods-buy' },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 私信发送失败通知
|
||||
export function onSendPrivateMessageFailed(receiverId: number, message: string, error: any) {
|
||||
const setting = useSettings();
|
||||
if (setting.settings.notificationSettings.enableTypes.includes("message-failed")) {
|
||||
const errorMsg = error instanceof Error ? error.message : String(error);
|
||||
window.$notification.error({
|
||||
title: "私信发送失败",
|
||||
description: `向用户 ${receiverId} 发送私信失败: ${errorMsg}`,
|
||||
duration: 8000,
|
||||
});
|
||||
trySendNotification({
|
||||
title: "私信发送失败",
|
||||
body: `向用户 ${receiverId} 发送私信失败`,
|
||||
extra: { type: 'message-failed' },
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user