feat(排行榜): 对接我的排名接口

This commit is contained in:
hzj 2025-09-29 21:07:48 +08:00
parent f2c71c1597
commit 4e2dcd9a45
2 changed files with 16 additions and 3 deletions

View File

@ -35,3 +35,15 @@ export const getRoomRanking = async () => {
throw error throw error
} }
} }
// 获取我的排名
export const getMyRanking = async () => {
try {
const response = await get(`/activity/leaderboard/my-rank`)
return response
} catch (error) {
console.error('Failed to fetch get my ranking:', error)
console.error('error:' + error.response.errorMsg)
throw error
}
}

View File

@ -271,7 +271,7 @@
import { isInApp, closePage } from '@/utils/appBridge.js' import { isInApp, closePage } from '@/utils/appBridge.js'
import { computed, onMounted, ref, watch, watchEffect } from 'vue' import { computed, onMounted, ref, watch, watchEffect } from 'vue'
import TopUser from '@/components/Ranking/topUser.vue' import TopUser from '@/components/Ranking/topUser.vue'
import { getWealthRanking, getCharmRanking, getRoomRanking } from '@/api/ranking' import { getWealthRanking, getCharmRanking, getRoomRanking, getMyRanking } from '@/api/ranking'
//vite //vite
const imageModules = import.meta.glob('@/assets/images/Ranking/*.{png,jpg,svg}', { eager: true }) const imageModules = import.meta.glob('@/assets/images/Ranking/*.{png,jpg,svg}', { eager: true })
@ -289,6 +289,7 @@ const selectedTimeTab = ref('Hourly') //时间标签
const totalRanking = ref({}) const totalRanking = ref({})
const showRanking = ref([]) const showRanking = ref([])
const myRanking = ref({}) //
const updateTimeRanking = () => { const updateTimeRanking = () => {
console.log('updateTimeRanking()') console.log('updateTimeRanking()')
@ -443,8 +444,8 @@ onMounted(() => {
observer.observe(sentinel.value) observer.observe(sentinel.value)
// getRanking() //
getRanking() getMyRanking() //
}) })
</script> </script>