余尚辉 1 ヶ月 前
コミット
feaa9f6a9d
2 ファイル変更3 行追加8 行削除
  1. 2 4
      src/layout/components/HeaderGroup/index.vue
  2. 1 4
      src/layout/index.vue

+ 2 - 4
src/layout/components/HeaderGroup/index.vue

@@ -43,9 +43,8 @@ const handlePopoverItem = async ({ state, label }) => {
  
     workbenchApi.getSeatsByUser({ userId: userStore.id }).then(async({ data }) => {
       if (!data) return;
-      voiceStore.HS_CTI_INSTANCE(data.outId);
-      setTimeout(async () => {
-        await voiceStore.getAgentStatus();
+      await useVoice.HS_CTI_INSTANCE(data.outId); 
+      await voiceStore.getAgentStatus();
         // console.log( "坐席状态 下", voiceStore.AGENTSTATUS );
         // console.log( "系统状态 下", voiceStore.HSCTIERRORCODE );
         // if ( !([100001, 100002].includes( Number(voiceStore.HSCTIERRORCODE)) ) ) {
@@ -55,7 +54,6 @@ const handlePopoverItem = async ({ state, label }) => {
         } else {
           voiceStore.systemState = false;
         }
-      }, 2000);
     })
   } else {
     /**

+ 1 - 4
src/layout/index.vue

@@ -23,9 +23,7 @@ const init = () => {
       
       await useVoice.HS_CTI_INSTANCE(data.outId);
       const voiceStatus = sessionStorage.getItem('VOICE_STATUS');
-      
-      setTimeout(async () => {
-        /**
+      /**
          * 如果用户在有登入的情况下,中途关闭麦克风,获取坐席状态仍是 1( getAgentStatus )
          * HSCTIERRORCODE :- - 100001: SDK 状态不可用,CTIStatus 的状态为 Terminated 100002: 获取坐席媒体权限失败
          * AGENTSTATUS : 1 置忙 2 置闲
@@ -46,7 +44,6 @@ const init = () => {
             useVoice.setIdle();
           }
         }
-      }, 2000);
     })
 }