39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
import { get, post } from '../utils/http.js'
|
|
|
|
// 获取排行榜和我的排名
|
|
export const getRankingListAndMyRanking = async (data) => {
|
|
try {
|
|
const response = await post(`/ranking/list`, data)
|
|
return response
|
|
} catch (error) {
|
|
console.error('Failed to get list and my ranking:', error)
|
|
console.error('error:' + error.response.errorMsg)
|
|
throw error
|
|
}
|
|
}
|
|
|
|
// 获取本周奖励和礼物
|
|
export const getThisWeekRewardsAndGifts = async (activityId) => {
|
|
try {
|
|
const response = await get(`/activity/king-queen/effective?templateId=${activityId}`)
|
|
return response
|
|
} catch (error) {
|
|
console.error('Failed to get this week rewards and gifts:', error)
|
|
console.error('error:' + error.response.errorMsg)
|
|
throw error
|
|
}
|
|
}
|
|
|
|
// 获取历史榜首
|
|
export const getHistoryTopOne = async (activityType) => {
|
|
try {
|
|
let data = { activityType }
|
|
const response = await post(`/ranking/historical-top1`, data)
|
|
return response
|
|
} catch (error) {
|
|
console.error('Failed to get history top one:', error)
|
|
console.error('error:' + error.response.errorMsg)
|
|
throw error
|
|
}
|
|
}
|