lex-xin 3 miesięcy temu
rodzic
commit
0226dcc6f4
1 zmienionych plików z 10 dodań i 10 usunięć
  1. 10 10
      src/tenant/music/coursewarePlay/index.tsx

+ 10 - 10
src/tenant/music/coursewarePlay/index.tsx

@@ -207,17 +207,17 @@ export default defineComponent({
       for (let j = 0; j < materialList.length; j++) {
         const material = materialList[j]
         //请求本地缓存
-        // if (browserInfo.isApp && ['VIDEO', 'IMG'].includes(material.typeCode)) {
-        //   const localData: any = await getCacheFilePath(material)
+        if (browserInfo.isApp && ['VIDEO', 'IMG'].includes(material.typeCode)) {
+          const localData: any = await getCacheFilePath(material)
 
-        //   if (localData?.content?.localPath) {
-        //     material.url = material.content
-        //     material.content = localData.content.localPath
-        //   } else {
-        //     material.url = material.content + '?t=' + +new Date()
-        //     material.content = material.content + '?t=' + +new Date()
-        //   }
-        // }
+          if (localData?.content?.localPath) {
+            material.url = material.content
+            material.content = localData.content.localPath
+          } else {
+            material.url = material.content + '?t=' + +new Date()
+            material.content = material.content + '?t=' + +new Date()
+          }
+        }
 
         material.iframeRef = null
         material.videoEle = null