|
|
@@ -128,6 +128,7 @@ import useImport from '@/hooks/useImport'
|
|
|
import { useSlidesStore } from '@/store/slides'
|
|
|
import { useVideoManager } from '@/hooks/useVideoManager'
|
|
|
import api from '@/services/course'
|
|
|
+import message from '@/utils/message'
|
|
|
|
|
|
const slidesStore = useSlidesStore()
|
|
|
const manager = useVideoManager()
|
|
|
@@ -355,6 +356,7 @@ const handleIframeLoad = async (event: Event) => {
|
|
|
slidesStore.updateElement({ id: info.id, props: { isDone: true } })
|
|
|
}
|
|
|
else {
|
|
|
+ message.warning('type=73 跨域,尝试抓取 HTML 做 srcdoc')
|
|
|
console.log('type=73 跨域,尝试抓取 HTML 做 srcdoc')
|
|
|
let html: string | null = null
|
|
|
try {
|
|
|
@@ -371,12 +373,14 @@ const handleIframeLoad = async (event: Event) => {
|
|
|
if (fd2?.data) html = new TextDecoder('utf-8').decode(new Uint8Array(fd2.data))
|
|
|
}
|
|
|
catch (e3) {
|
|
|
+ message.warning('type=73 抓取全部失败:' + e3)
|
|
|
console.error('type=73 抓取全部失败:', e3)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (html) {
|
|
|
+ message.warning('type=73 抓取成功,切换为 srcdoc' + html)
|
|
|
console.log('type=73 抓取成功,切换为 srcdoc')
|
|
|
// 更新 slidesStore:设 isHTML、url=html、curl=原始链接、isDone=true
|
|
|
// 触发 watch url → iframeKey++ → iframe 重建为 srcdoc 模式
|
|
|
@@ -386,6 +390,7 @@ const handleIframeLoad = async (event: Event) => {
|
|
|
})
|
|
|
return // updateElement 会触发 iframe 重建,不再走下面的 JS 注入
|
|
|
}
|
|
|
+ message.warning('type=73 抓取失败,回退为直接加载,标记 isDone')
|
|
|
console.warn('type=73 抓取失败,回退为直接加载,标记 isDone')
|
|
|
slidesStore.updateElement({ id: info.id, props: { isDone: true } })
|
|
|
|