|
|
@@ -2441,8 +2441,17 @@ const getCourseDetail = async () => {
|
|
|
jsonStr = new TextDecoder('utf-8').decode(uint8Array)
|
|
|
try {
|
|
|
const jsonObj = JSON.parse(jsonStr)
|
|
|
- checkPPTFile(JSON.stringify(jsonObj, null, 2))
|
|
|
- importJSON(jsonObj)
|
|
|
+ // 过滤掉 elements 中 type 为 image 的内容
|
|
|
+ const jsonObj2 = JSON.parse(JSON.stringify(jsonObj))
|
|
|
+ if (jsonObj2.slides) {
|
|
|
+ jsonObj2.slides.forEach((slide: any) => {
|
|
|
+ if (slide.elements) {
|
|
|
+ slide.elements = slide.elements.filter((element: any) => element.type !== 'image')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ checkPPTFile(JSON.stringify(jsonObj2, null, 2))
|
|
|
+ importJSON(jsonObj2)
|
|
|
}
|
|
|
catch (e) {
|
|
|
console.error('解析pptdata.data失败:', e)
|