From 894c303b9a3a43c874f982d2f3256440b2296d26 Mon Sep 17 00:00:00 2001 From: xy <2115269706@qq.com> Date: Fri, 21 Jun 2024 18:25:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=AE=E6=94=B9=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=9B=AE=E6=A0=87=E6=8E=A5=E5=8F=A3=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/courseChaptersApi.ts | 2 +- src/views/course/CourseObjectives.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/courseChaptersApi.ts b/src/api/courseChaptersApi.ts index ccfebcf..45525c2 100644 --- a/src/api/courseChaptersApi.ts +++ b/src/api/courseChaptersApi.ts @@ -96,7 +96,7 @@ export const deleteCourse = (params: any) => { // 获取详情 export const getCourseInfo = (params: any) => { return request({ - url: '/objective_contents/' + params.id, + url: 'api/objective_contents/' + params.id, method: "get", // params }) diff --git a/src/views/course/CourseObjectives.vue b/src/views/course/CourseObjectives.vue index 485a28d..428eac1 100644 --- a/src/views/course/CourseObjectives.vue +++ b/src/views/course/CourseObjectives.vue @@ -60,7 +60,7 @@ const handleClose = () => { const submit = async () => { if (flog.value) { await editCourse({ - id: activeIndex.value, + ...editdata.value, content: formData.value.description, }) } else { @@ -114,11 +114,13 @@ const filterTarger = (target) => { return res.label } +const editdata = ref({ id: '', objectiveId:'' }) // 编辑事件 const flog = ref(false) const editBook = async (obj) => { const res = await getCourseInfo({ id: obj.id }) - + editdata.value.id = res.data.id + editdata.value.objectiveId = res.data.objectiveId flog.value = true console.log(obj) activeIndex.value = res.data.id