feat(api): 添加热门行业和概念标签的获取接口

This commit is contained in:
傅光孟 2026-02-12 13:46:26 +08:00
parent 59b16f7323
commit b21592025f
3 changed files with 16 additions and 6 deletions

View File

@ -125,3 +125,13 @@ export const updateMyIndustries = (data: any) => {
export const updateMyTags = (data: any) => {
return Request.post("/user/tags", data);
};
// 热门行业
export const getHotByTagIndustry = (data: any) => {
return Request.get(`/news/hot/industry?name=${data.name}`);
};
// 概念标签
export const getHotByTag = (data: any) => {
return Request.get(`/news/hot/tag?name=${data.name}`);
};

View File

@ -25,7 +25,7 @@
</template>
<script setup lang="ts">
import { getListByTag } from "@/api/detail";
import { getHotByTag } from "@/api";
import { getTopConceptPeriod } from "@/api/newsInfo";
import { useUserStore } from "@/stores/user";
import dayjs from "dayjs";
@ -56,9 +56,9 @@ async function getTopConcept_dFn() {
async function getList() {
const name = topConceptList.value[active.value].content;
//
let { code, data } = await getListByTag({ name });
let { code, data } = await getHotByTag({ name });
if (code == 200) {
oneData.value = data && data.length > 0 ? data[0] : {};
oneData.value = data// && data.length > 0 ? data[0] : {};
}
}

View File

@ -29,7 +29,7 @@
</template>
<script setup lang="ts">
import { getListByTagIndustry } from "@/api/detail";
import { getHotByTagIndustry } from "@/api";
import { getTopIndustryPeriod } from "@/api/newsInfo";
import { useUserStore } from "@/stores/user";
import dayjs from "dayjs";
@ -61,9 +61,9 @@ async function getTopIndustry_dFn() {
async function getList() {
const name = industryList.value[active.value].content;
//
let { code, data } = await getListByTagIndustry({ name });
let { code, data } = await getHotByTagIndustry({ name });
if (code == 200) {
oneData.value = data && data.length > 0 ? data[0] : {};
oneData.value = data// && data.length > 0 ? data[0] : {};
}
}