|
@@ -1253,7 +1253,7 @@ const clearAllSyncStates = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取导入导出功能
|
|
// 获取导入导出功能
|
|
|
-const { readJSON, exportJSON2, getFile } = useImport()
|
|
|
|
|
|
|
+const { readJSON, exportJSON2, getFile, getFile2 } = useImport()
|
|
|
|
|
|
|
|
// 根据iframe的URL查找对应的幻灯片索引
|
|
// 根据iframe的URL查找对应的幻灯片索引
|
|
|
const findSlideIndexByIframeUrl = (iframeUrl: string): number => {
|
|
const findSlideIndexByIframeUrl = (iframeUrl: string): number => {
|
|
@@ -1507,15 +1507,26 @@ const processIframeLinks = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
catch (error) {
|
|
catch (error) {
|
|
|
- console.log(`getFile 失败,尝试使用 getHTML:`, error)
|
|
|
|
|
|
|
+ console.log(`getFile 失败,尝试使用 getFile2:`, error)
|
|
|
try {
|
|
try {
|
|
|
- html = await api.getHTML(iframeSrc)
|
|
|
|
|
- console.log('getHTML 成功获取内容:', html)
|
|
|
|
|
|
|
+ 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 (htmlError) {
|
|
|
|
|
- console.error('getHTML 也失败:', htmlError)
|
|
|
|
|
- console.error('无法获取内容: getFile 和 getHTML 都失败了')
|
|
|
|
|
- // throw new Error(`无法获取内容: getFile 和 getHTML 都失败了`)
|
|
|
|
|
|
|
+ catch (error2) {
|
|
|
|
|
+ console.log(`getFile2 失败,尝试使用 getHTML:`, error2)
|
|
|
|
|
+ try {
|
|
|
|
|
+ html = await api.getHTML(iframeSrc)
|
|
|
|
|
+ console.log('getHTML 成功获取内容:', html)
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (htmlError) {
|
|
|
|
|
+ console.error('getHTML 也失败:', htmlError)
|
|
|
|
|
+ console.error('无法获取内容: getFile、getFile2 和 getHTML 都失败了')
|
|
|
|
|
+ // throw new Error(`无法获取内容: getFile、getFile2 和 getHTML 都失败了`)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
console.log(`处理幻灯片 ${slideIndex + 1} 中的iframe链接:`, iframeSrc)
|
|
console.log(`处理幻灯片 ${slideIndex + 1} 中的iframe链接:`, iframeSrc)
|