lsc 1 tydzień temu
rodzic
commit
cb2cb53d72
1 zmienionych plików z 8 dodań i 1 usunięć
  1. 8 1
      src/components/pptEasyClass/index.vue

+ 8 - 1
src/components/pptEasyClass/index.vue

@@ -164,6 +164,13 @@ export default {
     },
     toggleRecording() {
       if (this.recordedForm.status == 1) {
+        // 检查录音时间是否至少为5秒
+        const now = Date.now();
+        const duration = (now - this.recordingStartTimestamp) / 1000;
+        if (duration < 5) {
+          this.$message.warning('录音时间至少需要5秒');
+          return;
+        }
         this.onFinishRecordWithMicrosoft();
       } else {
         this.onStartRecordWithMicrosoft();
@@ -309,7 +316,7 @@ export default {
         et: this.recordingEndTime
       };
       this.ajax
-        .post(this.$store.state.api + "addPPTClass", params)
+        .post(this.$store.state.api + "addPPTClass", [params])
         .then(res => {
           console.log("addPPTClass", res);
           let id = res.data[0][0].id;