From 375c18a6d2713ff19b22093eec57315992d8333f Mon Sep 17 00:00:00 2001
From: Codex Assistant <codex@example.com>
Date: 星期四, 06 十一月 2025 13:33:52 +0800
Subject: [PATCH] 增加评审下载
---
web/src/api/promotion.js | 43 +++++++++++++++++++++++++------------------
1 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/web/src/api/promotion.js b/web/src/api/promotion.js
index 6094476..ff02737 100644
--- a/web/src/api/promotion.js
+++ b/web/src/api/promotion.js
@@ -4,16 +4,23 @@
const GET_PROMOTION_COMPETITIONS = `
query GetPromotionCompetitions($name: String, $page: Int, $size: Int) {
promotionCompetitions(name: $name, page: $page, size: $size) {
- id
- competitionName
- stageName
- maxParticipants
- currentCount
- status
- startTime
- endTime
- sortOrder
- state
+ content {
+ id
+ competitionId
+ competitionName
+ stageName
+ maxParticipants
+ currentCount
+ status
+ startTime
+ endTime
+ sortOrder
+ state
+ }
+ totalElements
+ page
+ size
+ totalPages
}
}
`
@@ -78,8 +85,8 @@
page: params.page || 1,
size: params.size || 10
}
- const data = await graphqlRequest(GET_PROMOTION_COMPETITIONS, variables)
- return data.promotionCompetitions || []
+ const result = await graphqlRequest(GET_PROMOTION_COMPETITIONS, variables)
+ return result?.data?.promotionCompetitions || []
} catch (error) {
console.error('鑾峰彇姣旇禌鏅嬬骇鍒楄〃澶辫触:', error)
throw error
@@ -94,8 +101,8 @@
page: params.page || 1,
size: params.size || 10
}
- const data = await graphqlRequest(GET_COMPETITION_PARTICIPANTS, variables)
- return data.competitionParticipants || []
+ const result = await graphqlRequest(GET_COMPETITION_PARTICIPANTS, variables)
+ return result?.data?.competitionParticipants || []
} catch (error) {
console.error('鑾峰彇姣旇禌鍙傝禌浜哄憳澶辫触:', error)
throw error
@@ -106,8 +113,8 @@
async getPromotableParticipants(currentStageId) {
try {
const variables = { currentStageId }
- const data = await graphqlRequest(GET_PROMOTABLE_PARTICIPANTS, variables)
- return data.promotableParticipants
+ const result = await graphqlRequest(GET_PROMOTABLE_PARTICIPANTS, variables)
+ return result?.data?.promotableParticipants
} catch (error) {
console.error('鑾峰彇鍙檵绾у弬璧涜�呭垪琛ㄥけ璐�:', error)
throw error
@@ -124,8 +131,8 @@
targetStageId
}
}
- const data = await graphqlRequest(PROMOTE_PARTICIPANTS, variables)
- return data.promoteParticipants
+ const result = await graphqlRequest(PROMOTE_PARTICIPANTS, variables)
+ return result?.data?.promoteParticipants
} catch (error) {
console.error('鎵ц鏅嬬骇鎿嶄綔澶辫触:', error)
throw error
--
Gitblit v1.8.0