jack 3 days ago
parent
commit
1aad6715e9
1 changed files with 10 additions and 10 deletions
  1. 10 10
      src/views/Student/index.vue

+ 10 - 10
src/views/Student/index.vue

@@ -1503,22 +1503,22 @@ const processIframeLinks = async () => {
                   // 如果无法获取contentWindow,使用HTML方式
                   let html = null
                   try {
-                    const fileData = await getFile(iframeSrc)
-                    if (fileData && fileData.data) {
-                      const uint8Array = new Uint8Array(fileData.data)
-                      html = new TextDecoder('utf-8').decode(uint8Array)
-                      console.log('getFile 成功获取内容:', html)
-                    }
-                  }
-                  catch (error) {
-                    console.log(`getFile 失败,尝试使用 getFile2:`, error)
-                    try {
                       const fileData2 = await getFile2(iframeSrc)
                       if (fileData2 && fileData2.data) {
                         const uint8Array = new Uint8Array(fileData2.data)
                         html = new TextDecoder('utf-8').decode(uint8Array)
                         console.log('getFile2 成功获取内容:', html)
                       }
+                  }
+                  catch (error) {
+                    console.log(`getFile 失败,尝试使用 getFile2:`, error)
+                    try {
+                      const fileData = await getFile(iframeSrc)
+                      if (fileData && fileData.data) {
+                        const uint8Array = new Uint8Array(fileData.data)
+                        html = new TextDecoder('utf-8').decode(uint8Array)
+                        console.log('getFile 成功获取内容:', html)
+                      }
                     }
                     catch (error2) {
                       console.log(`getFile2 失败,尝试使用 getHTML:`, error2)