wujingjing
2025-04-12 a53d6201839688bfe259702e191f34314d06133c
src/components/chat/components/playBar/hook/useDigitalHuman.ts
@@ -93,13 +93,34 @@
   const speakContent = (content: string) => {
      // 打断之前的已收到xxx
      duix.break();
      duix?.break();
      isWaitingSpeak = false;
      duix.speak({
      duix?.speak({
         content,
      });
   };
   const closeOtherDigitalHuman = async () => {
      const response = await fetch(`https://duix.guiji.ai/duix-openapi-v2/v1/distroyCallSessionsByAppId?appId=${duixConfig.appId}`, {
         method: 'GET',
         headers: {
            priority: 'u=1, i',
            sig: duixConfig.sign,
         },
      });
      const data = await response.json();
      // const total = data.data.totalConcurrentNumber;
      // const user = data.data.userConcurrentNumber;
      // if (total === null || total === 0) {
      //    return false;
      // }
      // if (total !== null && total === user) {
      //    return false;
      // }
      // return true;
   };
   const startDuix = () => {
      const conversationId = duixConfig.conversationId; // duix平台会话id
@@ -212,8 +233,8 @@
      duixConfig.sign = await createSig(duixConfig.appId, duixConfig.appKey, 60 * 60 * duixConfig.expired);
      const isUsable = await checkIsUseable();
      if (!isUsable) {
         ElMessage.warning('"资源占用中,请检查后再试~"');
         return;
         await closeOtherDigitalHuman();
         // ElMessage.warning('"资源占用中,请检查后再试~"');
      }
      digitalHumanIsShow.value = true;