diff --git a/src/api/modules/comment.ts b/src/api/modules/comment.ts index f54a499..355ee33 100644 --- a/src/api/modules/comment.ts +++ b/src/api/modules/comment.ts @@ -29,6 +29,24 @@ export class CommentApi { return ApiRequest.get(`/lessons/${lessonId}/comments`, params) } + // 发送课程评论 + static async postCourseComment(courseId: string, data: { + content: string + imgs?: string + }): Promise> { + try { + console.log('🚀 发送课程评论:', { courseId, data }) + + const response = await ApiRequest.post(`/aiol/aiolComment/course/${courseId}/add`, data) + console.log('✅ 发送课程评论成功:', response) + + return response + } catch (error) { + console.error('❌ 发送课程评论失败:', error) + throw error + } + } + // 添加课程评论 static addCourseComment(courseId: number, data: { content: string diff --git a/src/views/CourseExchanged.vue b/src/views/CourseExchanged.vue index 94a9548..8a55664 100644 --- a/src/views/CourseExchanged.vue +++ b/src/views/CourseExchanged.vue @@ -446,11 +446,30 @@