lsc 23 timmar sedan
förälder
incheckning
7ca7a3bc1d
3 ändrade filer med 26 tillägg och 1 borttagningar
  1. 24 0
      src/services/course.ts
  2. 1 0
      src/types/slides.ts
  3. 1 1
      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

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

@@ -463,7 +463,7 @@ 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')