diff --git a/api/home/index.ts b/api/home/index.ts index 4c7f43e..1f6f42f 100644 --- a/api/home/index.ts +++ b/api/home/index.ts @@ -85,6 +85,6 @@ export const tab2 = () => { /** * 获取具有上下级关系的当前的名称 */ -export const getDictTree = (params: { dictType: string }) => { +export const getDictTree = (params: { type: number, id: number}) => { return useDollarFetchRequest.get>('/prod-api/app-api/business/dict/level-by-id', { query: params }) } diff --git a/components/kl-wallpaper-category/index.vue b/components/kl-wallpaper-category/index.vue index 38a92e2..5fedfbd 100644 --- a/components/kl-wallpaper-category/index.vue +++ b/components/kl-wallpaper-category/index.vue @@ -54,6 +54,7 @@ import { computed, ref } from 'vue' import { parent } from '~/api/upnew/index' import type { pageReq } from '~/api/upnew/types' + import { getDictTree } from '~/api/home/index' import { ArrowRight } from '@element-plus/icons-vue' const props = defineProps({ @@ -120,6 +121,15 @@ // } // getEditionsList() + // 获取面包屑 + const {data: breadList} = await useAsyncData(`breadList-${props.type}-${props.id}-${props.groundId}-${Date.now()}`, async () => { + const res = await getDictTree({ type: props.type, id: query.value.projectType }) + return res.data + }) + + console.log('breadList', breadList); + + /** 是否是初始化 */ const queryType = ref('init') /**获取分类下拉框 */