diff --git a/Yi.Bbs.Vue3/src/views/home/Index.vue b/Yi.Bbs.Vue3/src/views/home/Index.vue index 831a8efa..6d515fcf 100644 --- a/Yi.Bbs.Vue3/src/views/home/Index.vue +++ b/Yi.Bbs.Vue3/src/views/home/Index.vue @@ -75,18 +75,15 @@ - + @@ -116,12 +113,14 @@ import { getHomeDiscuss } from "@/apis/discussApi.js"; import { getWeek } from "@/apis/accessApi.js"; import { getRecommendedFriend, getRankingPoints } from "@/apis/analyseApi.js"; import PointsRanking from "./components/PointsRanking/index.vue"; +import RecommendFriend from "./components/RecommendFriend/index.vue"; const plateList = ref([]); const discussList = ref([]); const bannerList = ref([]); const weekList = ref([]); const pointList = ref([]); +const friendList = ref([]); const items = [{ user: "用户1" }, { user: "用户2" }, { user: "用户3" }]; //主题查询参数 @@ -144,6 +143,8 @@ onMounted(async () => { weekList.value = weekData; const { data: pointData } = await getRankingPoints(); pointList.value = pointData; + const { data: friendData } = await getRecommendedFriend(); + friendList.value = friendData; }); const weekXAxis = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]; diff --git a/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue b/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue index 79398bcc..0787a030 100644 --- a/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue +++ b/Yi.Bbs.Vue3/src/views/home/components/PointsRanking/index.vue @@ -56,9 +56,13 @@ const getStatusInfo = (type) => { }; const userLimit = computed(() => getStatusInfo(props.pointsData.userLimit)); -const userImageSrc = computed( - () => import.meta.env.VITE_APP_BASEAPI + "/file/" + props.pointsData.icon -); +const userImageSrc = computed(() => { + if (props.pointsData.icon) { + return import.meta.env.VITE_APP_BASEAPI + "/file/" + props.pointsData.icon; + } else { + return "favicon.ico"; + } +});