Bladeren bron

修改视频链接

yangg 2 maanden geleden
bovenliggende
commit
5ce7d07855

+ 72 - 16
pages/identity-verify/identity-verify.vue

@@ -119,7 +119,7 @@ export default {
       audioTranscript: '',
       videoPlaying: false,
       showDebugInfo: false, // 设置为true可以显示调试信息
-      videoUrl: 'http://121.36.251.245:9000/minlong/0a0b3516-e0bb-4f6c-874c-8aaaca9d7f8f.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T135206Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=4a79bc77f80ae7344f339717dbe505a3b152140251a6b2c76c1fd5c047b39c74', // 用于存储AI数字人视频URL
+      videoUrl: 'http://121.36.251.245:9000/minlong/9c139c99-a613-49f2-986b-8a3ac20a9b1b.mp4', // 用于存储AI数字人视频URL
       showReplayButton: false,
       cameraStream: null, // 存储摄像头流
       cameraError: null, // 存储摄像头错误信息
@@ -181,12 +181,12 @@ export default {
       showAnswerButton: false, // 控制答题按钮显示
       currentVideoIndex: 0, // 当前播放的视频索引
       videoList: [
-        'http://121.36.251.245:9000/minlong/0a0b3516-e0bb-4f6c-874c-8aaaca9d7f8f.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T135206Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=4a79bc77f80ae7344f339717dbe505a3b152140251a6b2c76c1fd5c047b39c74', // 第一段视频
-        'http://121.36.251.245:9000/minlong/9ab3fd68-a2e9-47a7-a05e-a6e2253ef22c.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T143129Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=7a0ebf1058252b5f76895b31a5293d4781b33ede63d32dce148350846aa20621', // 第二段视频
-        'http://121.36.251.245:9000/minlong/69406ce9-8d8e-48aa-ba2f-3b12ea5b6a6c.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T144114Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a43a06217a63f9bb6af975b1a7aa419b6f8e3d77d8c6c9c67d1070edfe60dc43', // 第三段视频
-        'http://121.36.251.245:9000/minlong/1cd448b2-16ea-4565-be25-2cf71d1bf7b2.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T144554Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=6ef5b0b160feab053e7d95952cdac62266d1a1eb48999efb17d7a3c4e0b495ed',
-        'http://121.36.251.245:9000/minlong/5a9ad6b2-0de8-48e3-8eb7-141a9bee4a9b.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T145623Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=8a2120a4c6b059d64f90620377fdda2536f9fff9c455d5140210ef35990758c6',
-        'http://121.36.251.245:9000/minlong/7aafb07e-ab0d-477e-9124-3263d0b7bf6f.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T145857Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=54ebe67d751c7e44a0f608b26175c9d076685a0e647e7e134cda22bbca2639eb'//结束
+        'http://121.36.251.245:9000/minlong/9c139c99-a613-49f2-986b-8a3ac20a9b1b.mp4', // 第一段视频
+        'http://121.36.251.245:9000/minlong/15467aca-2c1e-4d40-bebc-11fc984f0a24.mp4', // 第二段视频
+        'http://121.36.251.245:9000/minlong/a96f295c-ecba-4b08-b627-0ed0dc72d727.mp4', // 第三段视频
+        'http://121.36.251.245:9000/minlong/e152eb38-7e03-4bb0-8b8d-73d51342d2aa.mp4',
+        'http://121.36.251.245:9000/minlong/6381eec3-1373-400f-aa8c-e229b60522ea.mp4',
+        'http://121.36.251.245:9000/minlong/2a11fe78-38d5-4af3-91c8-a080feb122e0.mp4'//结束
       ],
       isRecording: false,
       recordingTimer: null,
@@ -1091,6 +1091,25 @@ export default {
       const openid = userInfo ? (JSON.parse(userInfo).openid || '') : '';
       const tenant_id = uni.getStorageSync('tenant_id') || '1';
       
+      // 根据当前视频索引映射到正确的问题ID
+      let questionId;
+      switch(this.currentVideoIndex) {
+        case 1: // 第一个问题
+          questionId = 10;
+          break;
+        case 2: // 第二个问题
+          questionId = 11;
+          break;
+        case 3: // 第三个问题
+          questionId = 12;
+          break;
+        case 4: // 第四个问题
+          questionId = 13;
+          break;
+        default:
+          questionId = 10; // 默认值
+      }
+      
       // 检查是否在浏览器环境中使用File对象
       if (typeof fileOrPath !== 'string') {
         // 在浏览器环境中,我们需要将File对象转换为FormData
@@ -1099,7 +1118,7 @@ export default {
         formData.append('openid', openid);
         formData.append('tenant_id', tenant_id);
         formData.append('application_id', 1);
-        formData.append('question_id', this.currentVideoIndex);
+        formData.append('question_id', questionId);
         formData.append('video_duration', 0);
         formData.append('has_audio', 'true'); // 明确标记视频包含音频
         
@@ -1175,7 +1194,7 @@ export default {
           openid: openid,
           tenant_id: tenant_id,
           application_id: 1,
-          question_id: this.currentVideoIndex,
+          question_id: questionId,
           video_duration: 0,
           has_audio: 'true'  // 明确标记视频包含音频
         },
@@ -1185,7 +1204,7 @@ export default {
             console.log('上传响应:', res);
             if (res.code === 2000) {
               // 获取上传后的视频URL
-              const videoUrl = res.data.url || res.data.photoUrl || '';
+              const videoUrl = res.data.permanent_link || res.data.url || '';
               if (videoUrl) {
                 // 提交到面试接口
                 this.submitVideoToInterview(videoUrl);
@@ -1222,14 +1241,33 @@ export default {
       });
     },
 
-    // 添加新方法:将视频URL提交到面试接口
+    // 修改 submitVideoToInterview 方法
     submitVideoToInterview(videoUrl) {
       console.log('提交视频URL到面试接口:', videoUrl);
       
-      // 准备请求参数,按照图片中的格式
+      // 根据当前视频索引映射到正确的问题ID
+      let questionId;
+      switch(this.currentVideoIndex) {
+        case 1: // 第一个问题(索引1是第二个视频,第一个是介绍视频)
+          questionId = 10;
+          break;
+        case 2: // 第二个问题
+          questionId = 11;
+          break;
+        case 3: // 第三个问题
+          questionId = 12;
+          break;
+        case 4: // 第四个问题
+          questionId = 13;
+          break;
+        default:
+          questionId = 10; // 默认值,以防万一
+      }
+      
+      // 准备请求参数,使用映射后的问题ID
       const requestData = {
         application_id: 1,
-        question_id: this.currentVideoIndex,
+        question_id: questionId,
         video_url: videoUrl,
         video_duration: 0,
         tenant_id: uni.getStorageSync('tenant_id') || '1'
@@ -1237,7 +1275,7 @@ export default {
       
       // 发送请求到面试接口
       uni.request({
-        url: 'http://192.168.66.187:8083/api/job/upload_video',
+        url: 'http://192.168.66.187:8083/api/job/upload_question_video',
         method: 'POST',
         data: requestData,
         header: {
@@ -1259,7 +1297,16 @@ export default {
             
             // 延迟一下再进入下一题,让用户看到成功提示
             setTimeout(() => {
-              this.proceedToNextQuestion();
+              // 检查是否完成了第五个视频问题(索引为4)
+              if (this.currentVideoIndex === 4) {
+                // 完成第五个问题后,跳转到相机页面
+                uni.navigateTo({
+                  url: '/pages/camera/camera'
+                });
+              } else {
+                // 否则继续正常流程
+                this.proceedToNextQuestion();
+              }
             }, 1500);
           } else {
             // 提交失败
@@ -1280,8 +1327,17 @@ export default {
       });
     },
 
-    // 添加新方法:进入下一个问题
+    // 修改 proceedToNextQuestion 方法
     proceedToNextQuestion() {
+      // 检查是否完成了第五个视频问题(索引为4)
+      if (this.currentVideoIndex === 4) {
+        // 完成第五个问题后,跳转到相机页面
+        uni.navigateTo({
+          url: '/pages/camera/camera'
+        });
+        return;
+      }
+      
       // 切换到下一个视频
       this.currentVideoIndex++;
       if (this.currentVideoIndex < this.videoList.length) {

+ 61 - 15
unpackage/dist/dev/mp-weixin/pages/identity-verify/identity-verify.js

@@ -12,7 +12,7 @@ const _sfc_main = {
       videoPlaying: false,
       showDebugInfo: false,
       // 设置为true可以显示调试信息
-      videoUrl: "http://121.36.251.245:9000/minlong/0a0b3516-e0bb-4f6c-874c-8aaaca9d7f8f.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T135206Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=4a79bc77f80ae7344f339717dbe505a3b152140251a6b2c76c1fd5c047b39c74",
+      videoUrl: "http://121.36.251.245:9000/minlong/9c139c99-a613-49f2-986b-8a3ac20a9b1b.mp4",
       // 用于存储AI数字人视频URL
       showReplayButton: false,
       cameraStream: null,
@@ -83,15 +83,15 @@ const _sfc_main = {
       currentVideoIndex: 0,
       // 当前播放的视频索引
       videoList: [
-        "http://121.36.251.245:9000/minlong/0a0b3516-e0bb-4f6c-874c-8aaaca9d7f8f.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T135206Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=4a79bc77f80ae7344f339717dbe505a3b152140251a6b2c76c1fd5c047b39c74",
+        "http://121.36.251.245:9000/minlong/9c139c99-a613-49f2-986b-8a3ac20a9b1b.mp4",
         // 第一段视频
-        "http://121.36.251.245:9000/minlong/9ab3fd68-a2e9-47a7-a05e-a6e2253ef22c.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T143129Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=7a0ebf1058252b5f76895b31a5293d4781b33ede63d32dce148350846aa20621",
+        "http://121.36.251.245:9000/minlong/15467aca-2c1e-4d40-bebc-11fc984f0a24.mp4",
         // 第二段视频
-        "http://121.36.251.245:9000/minlong/69406ce9-8d8e-48aa-ba2f-3b12ea5b6a6c.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T144114Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=a43a06217a63f9bb6af975b1a7aa419b6f8e3d77d8c6c9c67d1070edfe60dc43",
+        "http://121.36.251.245:9000/minlong/a96f295c-ecba-4b08-b627-0ed0dc72d727.mp4",
         // 第三段视频
-        "http://121.36.251.245:9000/minlong/1cd448b2-16ea-4565-be25-2cf71d1bf7b2.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T144554Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=6ef5b0b160feab053e7d95952cdac62266d1a1eb48999efb17d7a3c4e0b495ed",
-        "http://121.36.251.245:9000/minlong/5a9ad6b2-0de8-48e3-8eb7-141a9bee4a9b.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T145623Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=8a2120a4c6b059d64f90620377fdda2536f9fff9c455d5140210ef35990758c6",
-        "http://121.36.251.245:9000/minlong/7aafb07e-ab0d-477e-9124-3263d0b7bf6f.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20250416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250416T145857Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=54ebe67d751c7e44a0f608b26175c9d076685a0e647e7e134cda22bbca2639eb"
+        "http://121.36.251.245:9000/minlong/e152eb38-7e03-4bb0-8b8d-73d51342d2aa.mp4",
+        "http://121.36.251.245:9000/minlong/6381eec3-1373-400f-aa8c-e229b60522ea.mp4",
+        "http://121.36.251.245:9000/minlong/2a11fe78-38d5-4af3-91c8-a080feb122e0.mp4"
         //结束
       ],
       isRecording: false,
@@ -777,13 +777,30 @@ const _sfc_main = {
       const userInfo = common_vendor.index.getStorageSync("userInfo");
       const openid = userInfo ? JSON.parse(userInfo).openid || "" : "";
       const tenant_id = common_vendor.index.getStorageSync("tenant_id") || "1";
+      let questionId;
+      switch (this.currentVideoIndex) {
+        case 1:
+          questionId = 10;
+          break;
+        case 2:
+          questionId = 11;
+          break;
+        case 3:
+          questionId = 12;
+          break;
+        case 4:
+          questionId = 13;
+          break;
+        default:
+          questionId = 10;
+      }
       if (typeof fileOrPath !== "string") {
         const formData = new FormData();
         formData.append("file", fileOrPath);
         formData.append("openid", openid);
         formData.append("tenant_id", tenant_id);
         formData.append("application_id", 1);
-        formData.append("question_id", this.currentVideoIndex);
+        formData.append("question_id", questionId);
         formData.append("video_duration", 0);
         formData.append("has_audio", "true");
         const xhr = new XMLHttpRequest();
@@ -849,7 +866,7 @@ const _sfc_main = {
           openid,
           tenant_id,
           application_id: 1,
-          question_id: this.currentVideoIndex,
+          question_id: questionId,
           video_duration: 0,
           has_audio: "true"
           // 明确标记视频包含音频
@@ -859,7 +876,7 @@ const _sfc_main = {
             const res = JSON.parse(uploadRes.data);
             console.log("上传响应:", res);
             if (res.code === 2e3) {
-              const videoUrl = res.data.url || res.data.photoUrl || "";
+              const videoUrl = res.data.permanent_link || res.data.url || "";
               if (videoUrl) {
                 this.submitVideoToInterview(videoUrl);
               } else {
@@ -894,18 +911,35 @@ const _sfc_main = {
         }
       });
     },
-    // 添加新方法:将视频URL提交到面试接口
+    // 修改 submitVideoToInterview 方法
     submitVideoToInterview(videoUrl) {
       console.log("提交视频URL到面试接口:", videoUrl);
+      let questionId;
+      switch (this.currentVideoIndex) {
+        case 1:
+          questionId = 10;
+          break;
+        case 2:
+          questionId = 11;
+          break;
+        case 3:
+          questionId = 12;
+          break;
+        case 4:
+          questionId = 13;
+          break;
+        default:
+          questionId = 10;
+      }
       const requestData = {
         application_id: 1,
-        question_id: this.currentVideoIndex,
+        question_id: questionId,
         video_url: videoUrl,
         video_duration: 0,
         tenant_id: common_vendor.index.getStorageSync("tenant_id") || "1"
       };
       common_vendor.index.request({
-        url: "http://192.168.66.187:8083/api/job/upload_video",
+        url: "http://192.168.66.187:8083/api/job/upload_question_video",
         method: "POST",
         data: requestData,
         header: {
@@ -921,7 +955,13 @@ const _sfc_main = {
             });
             this.lastUploadedVideoUrl = videoUrl;
             setTimeout(() => {
-              this.proceedToNextQuestion();
+              if (this.currentVideoIndex === 4) {
+                common_vendor.index.navigateTo({
+                  url: "/pages/camera/camera"
+                });
+              } else {
+                this.proceedToNextQuestion();
+              }
             }, 1500);
           } else {
             common_vendor.index.showToast({
@@ -940,8 +980,14 @@ const _sfc_main = {
         }
       });
     },
-    // 添加新方法:进入下一个问题
+    // 修改 proceedToNextQuestion 方法
     proceedToNextQuestion() {
+      if (this.currentVideoIndex === 4) {
+        common_vendor.index.navigateTo({
+          url: "/pages/camera/camera"
+        });
+        return;
+      }
       this.currentVideoIndex++;
       if (this.currentVideoIndex < this.videoList.length) {
         this.videoUrl = this.videoList[this.currentVideoIndex];