From 4131d82e08bedc3397f6dfb4fffaac9330323cea Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Mon, 27 Oct 2025 13:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E7=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/courseTag.js | 4 ++-- src/views/tag/TagManage.vue | 28 +++++++++++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/api/courseTag.js b/src/api/courseTag.js index 000ea788..0e00a0ef 100644 --- a/src/api/courseTag.js +++ b/src/api/courseTag.js @@ -18,11 +18,11 @@ export const changeTagPublic = (id = {}) => http.post(`/admin/courseTag/changePu export const changeTagHot = (id = {}) => http.post(`/admin/courseTag/changeHotStatus`, id); //查询指定id的标签关联的所有课程 -export const showCourseByTag = (obj = {}) => http.post(`/admin/courseTag/showCourseByTag`, {params: obj}); +export const showCourseByTag = (obj = {}) => http.get(`/admin/courseTag/showCourseByTag`, {params: obj}); //解除指定id的课程和某个标签之间的关联关系 -export const unbindCourseTagRelation = (params = {}) => http.post(`/admin/courseTag/unbind`, params); +export const unbindCourseTagRelation = (id = {}) => http.post(`/admin/courseTag/unbind`, id); //编辑课程:标签模糊查询 export const searchTags = (params = {}) => http.post(`/admin/courseTag/searchTags`, params); diff --git a/src/views/tag/TagManage.vue b/src/views/tag/TagManage.vue index b96b7318..3f7b926a 100644 --- a/src/views/tag/TagManage.vue +++ b/src/views/tag/TagManage.vue @@ -3,7 +3,7 @@
-
+
{ console.log("showCourseByTag 结果 : ",res); if (res.status === 200) { - state.courseTableData = res.result?.list || []; - state.courseTableTotal = res.result?.count || 0; + state.courseTableData = res.data.data.records || []; + state.courseTableTotal = res.data.data.total || 0; if (state.courseTableTotal === 0) { state.courseDialogVisible = false; getTagList(); @@ -533,11 +543,11 @@ export default { // 解绑标签 const unbindCurrentTag = async (record) => { try { - const params = { + /* const params = { id: record.id, tagId: state.courseSearchParam.id, courseId: record.courseId - }; + };*/ /*const res = await apiCourseTag.unbindCourseTagRelation(params); if (res.status === 200) { @@ -545,7 +555,7 @@ export default { getCourseListByTag(); getTagList(); // 刷新主列表 }*/ - unbindCourseTagRelation(params).then ((res) => { + unbindCourseTagRelation(record.id).then ((res) => { console.log("解绑 结果 : ",res); if (res.status === 200) { message.success('解绑成功');