update response model

This commit is contained in:
2023-11-11 19:20:31 +08:00
parent 2fdb8ff0e0
commit 0847af205e

View File

@@ -3,7 +3,7 @@ import { computed, h, onMounted, onUnmounted, ref } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { QueryGetAPI, QueryPostAPI } from '@/api/query' import { QueryGetAPI, QueryPostAPI } from '@/api/query'
import { LOTTERY_API_URL, OPEN_LIVE_API_URL } from '@/data/constants' import { LOTTERY_API_URL, OPEN_LIVE_API_URL } from '@/data/constants'
import { LotteryUserInfo, OpenLiveInfo, OpenLiveLotteryType, OpenLiveLotteryUserInfo } from '@/api/api-models' import { LotteryUserInfo, OpenLiveInfo, OpenLiveLotteryType, OpenLiveLotteryUserInfo, UpdateLiveLotteryUsersModel } from '@/api/api-models'
import { import {
NAlert, NAlert,
NAvatar, NAvatar,
@@ -128,7 +128,7 @@ async function get() {
} }
async function getUsers() { async function getUsers() {
try { try {
const data = await QueryGetAPI<OpenLiveLotteryUserInfo[]>(LOTTERY_API_URL + 'live/get-users', { const data = await QueryGetAPI<UpdateLiveLotteryUsersModel>(LOTTERY_API_URL + 'live/get-users', {
code: code.value, code: code.value,
}) })
if (data.code == 200) { if (data.code == 200) {
@@ -356,7 +356,7 @@ let timer: any
onMounted(async () => { onMounted(async () => {
authInfo.value = route.query as unknown as AuthInfo authInfo.value = route.query as unknown as AuthInfo
if (authInfo.value?.Code) { if (authInfo.value?.Code) {
const users = (await getUsers()) ?? [] const users = (await getUsers())?.users ?? []
originUsers.value = users originUsers.value = users
currentUsers.value = JSON.parse(JSON.stringify(users)) currentUsers.value = JSON.parse(JSON.stringify(users))
console.log('[OPEN-LIVE-Lottery] 从历史记录中加载 ' + users.length + ' 位用户') console.log('[OPEN-LIVE-Lottery] 从历史记录中加载 ' + users.length + ' 位用户')