diff --git a/src/api/assets/category/index.ts b/src/api/assets/category/index.ts index 0bf12e6..40c70ca 100644 --- a/src/api/assets/category/index.ts +++ b/src/api/assets/category/index.ts @@ -56,11 +56,11 @@ export function updateCategory(data: object) { } // 删除分类 -export function deleteCategory(bid: string) { +export function deleteCategory(id: number) { return newService({ url: '/assets/category/deleteCategory', method: 'delete', - params: { bid }, + params: { id }, }); } diff --git a/src/views/assets/category/component/editCategory.vue b/src/views/assets/category/component/editCategory.vue index 85cfd6c..3eb48a4 100644 --- a/src/views/assets/category/component/editCategory.vue +++ b/src/views/assets/category/component/editCategory.vue @@ -6,7 +6,7 @@ { getCategory(row.id).then((res: any) => { const data = res.data; ruleForm.id = data.id || ''; - ruleForm.parentId = data.bid || ''; + ruleForm.parentId = data.parentId || ''; ruleForm.name = data.name || ''; ruleForm.sort = data.sort || 0; // 处理 attrs 中的 options 字段 diff --git a/src/views/assets/category/index.vue b/src/views/assets/category/index.vue index 44a929e..0f00dbb 100644 --- a/src/views/assets/category/index.vue +++ b/src/views/assets/category/index.vue @@ -74,7 +74,6 @@ import { getCategoryTree, deleteCategory, updateCategoryStatus,listCategories } interface CategoryRow { id: number; - bid: string; name: string; level: number; type: string; @@ -154,7 +153,7 @@ const onRowDel = (row: CategoryRow) => { type: 'warning', }) .then(() => { - deleteCategory(row.bid).then(() => { + deleteCategory(row.id).then(() => { ElMessage.success('删除成功'); getCategoryList(); });