Kaynağa Gözat

Update index.tsx

lex 1 yıl önce
ebeveyn
işleme
e6f41569d2
1 değiştirilmiş dosya ile 17 ekleme ve 12 silme
  1. 17 12
      src/views/coursewarePlay/index.tsx

+ 17 - 12
src/views/coursewarePlay/index.tsx

@@ -179,7 +179,10 @@ export default defineComponent({
         const material = materialList[j];
         //请求本地缓存
         if (browserInfo.isApp && ['VIDEO', 'IMG'].includes(material.typeCode)) {
-          const localData = await getCacheFilePath(material);
+          const localData: any =
+            state.platformType === 'STUDENT'
+              ? await getCacheFilePath(material)
+              : {};
           if (localData?.content?.localPath) {
             material.url = material.content;
             material.content = localData.content.localPath;
@@ -340,18 +343,20 @@ export default defineComponent({
       await getDetail();
       const hasFree = String(data.detail?.accessScope) === '0';
       if (!hasFree) {
-        const hasVip = handleCheckVip();
-        if (!hasVip) {
-          nextTick(() => {
-            postMessage({
-              api: 'courseLoading',
-              content: {
-                show: false,
-                type: 'fullscreen'
-              }
+        if (state.platformType === 'STUDENT') {
+          const hasVip = handleCheckVip();
+          if (!hasVip) {
+            nextTick(() => {
+              postMessage({
+                api: 'courseLoading',
+                content: {
+                  show: false,
+                  type: 'fullscreen'
+                }
+              });
             });
-          });
-          return;
+            return;
+          }
         }
       }
       // getCourseSchedule();