diff --git a/src/AppConfig.js b/src/AppConfig.js index 970cd620..66814afe 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || 'a' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/military/qz2022.js b/src/military/qz2022.js index 3aa9dccd..ff8a4fcf 100644 --- a/src/military/qz2022.js +++ b/src/military/qz2022.js @@ -82,10 +82,10 @@ const Qz2022 = (props) => { const menu = (
); diff --git a/src/military/qz2022/api.js b/src/military/qz2022/api.js index 764d109a..e2085e1b 100644 --- a/src/military/qz2022/api.js +++ b/src/military/qz2022/api.js @@ -21,8 +21,8 @@ export async function enrollUpdate(data){ } // 统计启智2022 竞赛 -export async function stattistics(data){ - return axios.get( `/competition_infos/qz2022/statistics.json`); +export async function stattistics(competitionId){ + return axios.get( `/competition_infos/${competitionId}/statistics.json`); } // 竞赛提交作品 diff --git a/src/military/qz2022/statistics/index.jsx b/src/military/qz2022/statistics/index.jsx index 55b2ade5..3e2dbd06 100644 --- a/src/military/qz2022/statistics/index.jsx +++ b/src/military/qz2022/statistics/index.jsx @@ -12,7 +12,8 @@ import EchartBar from './EchartBar'; const initBarYData = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]; -function Statistics({ showNotification, qzDetail }) { +function Statistics({ showNotification, qzDetail,match }) { + const {competitionId}=match.params; const is_local= qzDetail &&qzDetail.is_local; const [pieArr, setPieArr] = useState([]); @@ -24,7 +25,7 @@ function Statistics({ showNotification, qzDetail }) { useEffect(() => { - stattistics().then(res => { + stattistics(competitionId).then(res => { if (res && res.data && Array.isArray(res.data.data)) { let pieArrList = []; let xData = [];