SanHQin 1 day ago
parent
commit
74f64dff4d

+ 1 - 1
dist/index.html

@@ -32,7 +32,7 @@
     html,
     body{
       font-family: '黑体';
-    }</style><link href=./static/css/app.690252b046c7707d94a06b85eef49a0a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.becc9317549795ada446.js></script><script type=text/javascript src=./static/js/app.b2b68d534d916d3c9181.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.11f3b4be875c1bb5ac3aa39b0767f197.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.becc9317549795ada446.js></script><script type=text/javascript src=./static/js/app.8c9a6d64fc3d8bfa2add.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.11f3b4be875c1bb5ac3aa39b0767f197.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/app.11f3b4be875c1bb5ac3aa39b0767f197.css.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.8c9a6d64fc3d8bfa2add.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.8c9a6d64fc3d8bfa2add.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map


+ 25 - 37
src/components/pptEasyClass/index.vue

@@ -174,16 +174,7 @@ export default {
       this.onStartRecordWithMicrosoft();
     },
     toggleRecording() {
-      navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(permissionStatus => {
-        if (permissionStatus.state !== "granted") {
-          // 没有开启录音权限,直接确定停止录音
-          this.recordedForm.status = "0";
-          let iframe = this.$refs["iiframe"];
-          iframe.contentWindow.onSessionStopped = null;
-          iframe.contentWindow.window.onRecognizedResult = null;
-          this.$message.success(this.lang.ssNoPermStop);
-          return;
-        }
+
       if (this.recordedForm.status == 1) {
         // 检查录音时间是否至少为5秒
         const now = new Date();
@@ -218,7 +209,7 @@ export default {
         }
         this.onStartRecordWithMicrosoft();
       }
-    })
+    // })
     },
     // ============ start 微软录音转译
     onStartRecordWithMicrosoft() {
@@ -283,36 +274,32 @@ export default {
       };
 
       iiframe.contentWindow.ConversationTranscriber();
-      // 优化录音权限检测和处理流程,防止多次触发和潜在异常
-      setTimeout(async () => {
-        try {
-          if (navigator.permissions) {
-            const permissionStatus = await navigator.permissions.query({ name: 'microphone' });
-            if (permissionStatus.state !== "granted") {
-              // 没有开启录音权限,直接确定停止录音
-              this.recordedForm.status = "0";
-              const iframe = this.$refs["iiframe"];
-              if (iframe && iframe.contentWindow) {
-                if (typeof iframe.contentWindow.onSessionStopped !== "undefined") {
-                  iframe.contentWindow.onSessionStopped = null;
-                }
-                if (iframe.contentWindow.window && typeof iframe.contentWindow.window.onRecognizedResult !== "undefined") {
-                  iframe.contentWindow.window.onRecognizedResult = null;
-                }
-              }
-              if (this.$message && this.lang && this.lang.ssNoPermStop) {
-                this.$message.success(this.lang.ssNoPermStop);
-              }
-              return;
-            }
-          }
-        } catch (error) {
-          console.error('麦克风权限检测异常:', error);
+      setTimeout(()=>{
+        navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(permissionStatus => {
+        if (permissionStatus.state !== "granted") {
+          // 没有开启录音权限,直接确定停止录音
+          this.recordedForm.status = "0";
+          let iframe = this.$refs["iiframe"];
+          iframe.contentWindow.onSessionStopped = null;
+          iframe.contentWindow.window.onRecognizedResult = null;
+          this.$message.success(this.lang.ssNoPermStop);
+          return;
         }
-      }, 10000);
+      })
+      },10000)
 
     },
     async onFinishRecordWithMicrosoft() {
+      navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(async permissionStatus => {
+        if (permissionStatus.state !== "granted") {
+          // 没有开启录音权限,直接确定停止录音
+          this.recordedForm.status = "0";
+          let iframe = this.$refs["iiframe"];
+          iframe.contentWindow.onSessionStopped = null;
+          iframe.contentWindow.window.onRecognizedResult = null;
+          this.$message.success(this.lang.ssNoPermStop);
+          return;
+        }
       if (this.recordedForm.status == 1) {
         //正在录音时
         let iiframe = this.$refs["iiframe"];
@@ -366,6 +353,7 @@ export default {
         // 调用 addPPTClass 接口
         this.addPPTClass(file);
       }
+      })
     },
     storeRecordingData(file) {
       // 配置全局 window 对象存储录音数据

Some files were not shown because too many files changed in this diff