diff --git a/api/home/index.ts b/api/home/index.ts index 2d557e5..f2b3cda 100644 --- a/api/home/index.ts +++ b/api/home/index.ts @@ -79,6 +79,5 @@ export const getSettingPage = (params: { type: number }) => { * 首页-标签2 */ export const tab2 = () => { - return useFetchRequest.get>('/prod-api/app-api/business/project/index/index-tab2', { - }) + return useFetchRequest.get>('/prod-api/app-api/business/project/index/index-tab2', {}) } diff --git a/composables/useDollarFetchRequest.ts b/composables/useDollarFetchRequest.ts index 63e50ea..cc38377 100644 --- a/composables/useDollarFetchRequest.ts +++ b/composables/useDollarFetchRequest.ts @@ -20,7 +20,7 @@ const useClientRequest = async ( } }, onResponse({ response }) { - if (+response.status === 200 && +response._data.code !== 200) { + if (+response.status === 200 && +response._data.code !== 0) { ElMessage.error(response._data.msg); } }, diff --git a/composables/useFetchRequest.ts b/composables/useFetchRequest.ts index 5b4ef53..8df1a1b 100644 --- a/composables/useFetchRequest.ts +++ b/composables/useFetchRequest.ts @@ -43,6 +43,9 @@ const useServerRequest = async ( endpoint: string, config?: Omit ): Promise => { + console.log('config----', config); + + // @ts-ignore return useServerRequest(endpoint, { ...config, method: 'GET' }) } diff --git a/pages/home/components/LearningRecommendations.vue b/pages/home/components/LearningRecommendations.vue index 0e53ea1..460e11f 100644 --- a/pages/home/components/LearningRecommendations.vue +++ b/pages/home/components/LearningRecommendations.vue @@ -31,7 +31,7 @@ status: 0, }) - const { data: bannerList } = useAsyncData('get-setting-Page', async () => { + const { data: bannerList } = useAsyncData('get-setting-Page-learning-recommendations', async () => { const res = await getSettingPage(pageReq) return res.data }) diff --git a/pages/home/components/MainContent.vue b/pages/home/components/MainContent.vue index b43ee57..8a891f9 100644 --- a/pages/home/components/MainContent.vue +++ b/pages/home/components/MainContent.vue @@ -39,27 +39,18 @@ import LoginForm from "./LoginForm.vue"; import { Vue3Marquee } from "vue3-marquee"; import { getSettingPage } from "~/api/home/index"; -import type { PageResultIndexSettingRespVO } from "~/api/home/type"; const pageReq = reactive({ type: 1, status: 0, }); -const { data: bannerList } = useAsyncData("get-setting-Page", async () => { +const { data: bannerList } = useAsyncData("get-setting-Page-main-content", async () => { + const res = await getSettingPage(pageReq); return res.data; }); -// const bannerList = ref([]) -// const getBanner = async () => { -// const res = await getSettingPage(pageReq) -// if (res.code === 0) { -// bannerList.value = res.data -// } -// } -// getBanner() - const handleClick = (url: string) => { if (url) { navigateTo(url);