From 4fb57c13c7dad6925a7abf86a5d7bf820a55cd19 Mon Sep 17 00:00:00 2001 From: wangqiao Date: Sat, 30 Aug 2025 10:47:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E6=A0=91API=E5=8F=82=E6=95=B0=E5=92=8C=E9=9D=A2?= =?UTF-8?q?=E5=8C=85=E5=B1=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/home/index.ts | 2 +- components/kl-wallpaper-category/index.vue | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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') /**获取分类下拉框 */