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