Sfoglia il codice sorgente

Merge branch 'master' of https://git.cocorobo.cn/jack/PPT

jack 1 giorno fa
parent
commit
ac3acd9a69
3 ha cambiato i file con 28 aggiunte e 3 eliminazioni
  1. 24 0
      src/services/course.ts
  2. 1 0
      src/types/slides.ts
  3. 3 3
      src/views/Student/index.vue

+ 24 - 0
src/services/course.ts

@@ -33,7 +33,31 @@ export const submitWork = (params: SubmitWorkParams): Promise<any> => {
   return axios.post(`${API_URL}addCourseWorks_workPage`, [params])
 }
 
+/**
+ * 查看作业接口
+ * @param cid 课程ID
+ * @param s s参数,传0
+ * @param t 第几页幻灯片
+ * @returns Promise<any>
+ */
+export const selectSWorks = (cid: string, s: string, t: string): Promise<any> => {
+  return axios.get(`${API_URL}selectSWorks`, {
+    params: {
+      cid,
+      s,
+      t,
+    },
+  })
+}
+
+export const getHTML = (url: string): Promise<any> => {
+  return axios.get(`${url}`)
+}
+
+
 export default {
   getCourseDetail,
   submitWork,
+  selectSWorks,
+  getHTML,
 }

+ 1 - 0
src/types/slides.ts

@@ -644,6 +644,7 @@ export interface PPTAudioElement extends PPTBaseElement {
 export interface PPTFrameElement extends PPTBaseElement {
   type: 'frame'
   url: string
+  isHTML?: boolean
 }
 
 export type PPTElement = PPTTextElement | PPTImageElement | PPTShapeElement | PPTLineElement | PPTChartElement | PPTTableElement | PPTLatexElement | PPTVideoElement | PPTAudioElement | PPTFrameElement

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

@@ -463,10 +463,10 @@ const processIframeLinks = async () => {
                     return element
                   }
                 } 
-                else if (iframeSrc.includes('.html')) {
+                else if (iframeSrc.includes('.html') || iframeSrc.includes('.htm')) {
                   hasIframe = true
-                  // const html = await api.getHTML(iframeSrc)
-                  const html = await api.getHTML('https://knowledge.cocorobo.cn/zh-CN/story-telling/a7fa08b8-cf60-11ef-93e3-12e77c4cb76b')
+                  const html = await api.getHTML(iframeSrc)
+                  // const html = await api.getHTML('https://knowledge.cocorobo.cn/zh-CN/story-telling/a7fa08b8-cf60-11ef-93e3-12e77c4cb76b')
                   console.log('html', html)
                   console.log(`处理幻灯片 ${slideIndex + 1} 中的iframe链接:`, iframeSrc)
                   return {