xuqiaoying преди 2 години
родител
ревизия
01574c36c0
променени са 3 файла, в които са добавени 19 реда и са изтрити 16 реда
  1. 1 1
      common/request.js
  2. 8 8
      pages/index/index.vue
  3. 10 7
      pages3/polyv/detail.vue

+ 1 - 1
common/request.js

@@ -108,7 +108,7 @@ export const myRequest = (options) => {
 					title: "请求接口失败",
 					icon: 'none'
 				})
-				console.log('请求失败err---: ', err);
+				console.log('请求失败err---: ', options.url);
 				if (options.url == '/face/certification/CompareFace') {
 					console.log('人脸识别错误---1:', err)
 				}

+ 8 - 8
pages/index/index.vue

@@ -339,15 +339,15 @@ export default {
 			uni.setStorageSync('h5_code', this.optObj.code)
 			this.OfficialLogin()
 		} else {
-			console.log('没有code', uni.getStorageSync('h5_code'));
+			console.log('没有code');
 			// 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名,就拿到code了
-			// if (!uni.getStorageSync('h5_code')) {
-			// 	location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
-			// 	return
-			// } else {
-			// 	this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
-			// 	this.OfficialLogin()
-			// }
+			if (!uni.getStorageSync('h5_code')) {
+				location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
+				return
+			} else {
+				// this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
+				// this.OfficialLogin()
+			}
 		}
 		// #endif
 		this.getInfo() // 判断有没有关注公众号		

+ 10 - 7
pages3/polyv/detail.vue

@@ -3426,8 +3426,9 @@ export default {
     // 播放视频
     loadPlayer() {
       const polyvPlayer = window.polyvPlayer
-      console.log('h5开始', this.recordObj.videoCurrentTime, 666, this.vid);
+      console.log('h5开始',polyvPlayer, this.recordObj.videoCurrentTime, 666, this.vid);
       this.$api.polyvVideoSign(this.vid).then(async (res) => {
+        console.log('播放凭证res', res);
         this.player = await polyvPlayer({
           wrap: "#player",
           width: '100%',
@@ -3435,6 +3436,7 @@ export default {
           height: 218,
           ban_history_time: "on",
           vid: this.vid,
+          forceH5: true,
           autoplay: this.autoplay, // 自动播放
           ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
           speed: this.playbackRate, // 倍数
@@ -3444,12 +3446,13 @@ export default {
           watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
           ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
           sign: res.data.data.sign, // 移动端播放加密视频所需的签名
-          playsafe: (vid, next) => { // PC端播放加密视频所需的授权凭证
-            next();
-            // this.$api.obtainpolyvvideopcsign(vid).then((res) => {
-            //   next(res.data);
-            // });
-          },
+          // playsafe: (vid, next) => { // PC端播放加密视频所需的授权凭证
+          // console.log('111111111111', vid);
+          //   // this.$api.obtainpolyvvideopcsign(vid).then((res) => {
+          //   //   console.log('请求完后', res);
+          //   //   next(res.data.data);
+          //   // });
+          // },
         });
 
         polyvPlayerContext = this.player