From 1f80e9dae4521edf4cf4112a4b7521cb095d82d2 Mon Sep 17 00:00:00 2001 From: wayn <1669738430@qq.com> Date: Wed, 29 Jul 2020 00:47:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E7=B1=BBtab?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/category.js | 6 +++--- src/views/category/index.vue | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/api/category.js b/src/api/category.js index 510ee95..e39019b 100644 --- a/src/api/category.js +++ b/src/api/category.js @@ -6,10 +6,10 @@ export function getCategoryData() { method: 'get' }) } -export function getCategoryContent(data) { +export function getCategoryContent(query) { return request({ url: '/category/content', - method: 'post', - data + method: 'get', + params: query }) } diff --git a/src/views/category/index.vue b/src/views/category/index.vue index b124801..c5ccfc0 100644 --- a/src/views/category/index.vue +++ b/src/views/category/index.vue @@ -58,15 +58,15 @@ export default { }, getCategoryContent() { getCategoryContent({ - index: this.active + id: this.categoryList[this.active].id }).then((res) => { - const { currentCategory, listItem } = res.map - this.subCategoryList = listItem + const { currentCategory, subCategoryList } = res.map this.currentCategory = currentCategory + this.subCategoryList = subCategoryList }) }, onNavClick() { - this.getCateContent() + this.getCategoryContent() } } }