fix: 聊天功能(部分),图片发送,视频发送,音频发送已完成,好友列表,聊天记录以对接
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled

This commit is contained in:
2025-07-25 13:02:19 +08:00
parent 2423326951
commit c93cbec021
15 changed files with 1740 additions and 1293 deletions

View File

@@ -3,6 +3,24 @@ import type { DescItem } from '#/components/description';
import { isFunction } from '@vben/utils';
import SysAudioMp3 from '/public/audio/sys.mp3';
export const playOnceAndDestroySys = () => {
const audio = new Audio(SysAudioMp3);
// 播放音频
audio.play().catch((error) => {
console.error('音频播放失败:', error);
audio.remove(); // 如果播放失败,也移除音频对象
});
// 播放结束后销毁音频对象
audio.addEventListener('ended', () => {
audio.remove(); // 移除DOM中的audio元素如果是动态创建的
audio.src = ''; // 清空音频源以释放内存
});
};
export const omit = (obj: any, keysToOmit: string[]) => {
// 如果 obj 不是对象或者 keysToOmit 不是数组,则直接返回 obj
if (typeof obj !== 'object' || !Array.isArray(keysToOmit)) {