From 256bc0e00f01902e135930e6c210dd92bcf7312c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= <1431128779@qq.com> Date: Wed, 11 Jun 2025 15:57:35 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E9=A6=96=E9=A1=B5=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/v2/all.api.js | 10 +++++++++- pages/tabbar/home/home.vue | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/api/v2/all.api.js b/api/v2/all.api.js index 93681d6..c7d732a 100644 --- a/api/v2/all.api.js +++ b/api/v2/all.api.js @@ -3,6 +3,7 @@ */ import HaloTokenConfig from '@/config/token.config.js' import HttpHandler from '@/common/http/request.js' +import qs from 'qs' import { getAppConfigs @@ -42,7 +43,14 @@ export default { * @param {Object} params 查询参数 */ getCategoryList: (params) => { - return HttpHandler.Get('/apis/api.content.halo.run/v1alpha1/categories', params) + const param = qs.stringify(params, { + allowDots: true, + encodeValuesOnly: true, + skipNulls: true, + encode: false, + arrayFormat: 'repeat' + }) + return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/categories?${param}`,{}) }, /** * 查询分类下的文章 diff --git a/pages/tabbar/home/home.vue b/pages/tabbar/home/home.vue index a2b24c9..585e47b 100644 --- a/pages/tabbar/home/home.vue +++ b/pages/tabbar/home/home.vue @@ -214,7 +214,9 @@ export default { } this.$httpApi.v2 - .getCategoryList({}) + .getCategoryList({ + fieldSelector:['spec.hideFromList==false'] + }) .then(res => { this.categoryList = res.items.sort((a, b) => { return b.postCount - a.postCount;