mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 13:19:31 +08:00
update: 首页分类查询过滤
This commit is contained in:
+9
-1
@@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import HaloTokenConfig from '@/config/token.config.js'
|
import HaloTokenConfig from '@/config/token.config.js'
|
||||||
import HttpHandler from '@/common/http/request.js'
|
import HttpHandler from '@/common/http/request.js'
|
||||||
|
import qs from 'qs'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getAppConfigs
|
getAppConfigs
|
||||||
@@ -42,7 +43,14 @@ export default {
|
|||||||
* @param {Object} params 查询参数
|
* @param {Object} params 查询参数
|
||||||
*/
|
*/
|
||||||
getCategoryList: (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}`,{})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 查询分类下的文章
|
* 查询分类下的文章
|
||||||
|
|||||||
@@ -214,7 +214,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.$httpApi.v2
|
this.$httpApi.v2
|
||||||
.getCategoryList({})
|
.getCategoryList({
|
||||||
|
fieldSelector:['spec.hideFromList==false']
|
||||||
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.categoryList = res.items.sort((a, b) => {
|
this.categoryList = res.items.sort((a, b) => {
|
||||||
return b.postCount - a.postCount;
|
return b.postCount - a.postCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user