添加网站TDK设置获取功能

This commit is contained in:
wangqiao
2025-09-03 09:08:16 +08:00
parent e0507f3bd1
commit 21780580b8
4 changed files with 23 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import type {
ProjectDrawStatisticAppRespVO,
ProjectTrendingScoreUserInfoVO,
PageResultIndexSettingRespVO,
TdkSettingsRespVO,
} from './type'
/**
@ -88,3 +89,10 @@ export const tab2 = () => {
export const getDictTree = (params: { type: number, id: number}) => {
return useDollarFetchRequest.get<IResponse<ProjectDictNodeVO[]>>('/prod-api/app-api/business/app/dict/path-by-id', { query: params })
}
/**
* 获得网站 TDK设置
*/
export const getTDK = () => {
return useFetchRequest.get<IResponse<TdkSettingsRespVO>>('/prod-api/app-api/business/tdk-settings/get-index', {})
}

View File

@ -105,3 +105,10 @@ export interface PageResultIndexSettingRespVO {
status: number
createTime: string
}
export interface TdkSettingsRespVO {
title: string
describe: string
keywork: string
}

View File

@ -16,7 +16,7 @@
})
useHead({
title: `${props.title} - 图夕夕`,
title: `${props.title}`,
meta: [
{ name: 'description', content: `${props.description}`},
{ name: 'keywords', content: props.keywords },

View File

@ -1,5 +1,6 @@
<template>
<div class="ma-auto w-1440px">
<SeoHead :title="tdkData?.title" :description="tdkData?.describe" :keywords="tdkData?.keywork" />
<!-- 搜索 -->
<KlSearch></KlSearch>
<!-- 菜单 -->
@ -29,6 +30,12 @@
import PopularDrawings from '~/pages/home/components/PopularDrawings.vue'
import Leaderboard from '~/pages/home/components/Leaderboard.vue'
import LearningRecommendations from '~/pages/home/components/LearningRecommendations.vue'
import { getTDK } from '~/api/home/index'
const { data: tdkData } = useAsyncData('get-tdk-home', async () => {
const res = await getTDK()
return res.data
})
</script>
<style scoped>