我们提供一站式网上办事大厅招投标所需全套资料,包括师生办事大厅介绍PPT、一网通办平台产品解决方案、
师生服务大厅产品技术参数,以及对应的标书参考文件,详请联系客服。
from flask import Flask, jsonify, request app = Flask(__name__) @app.route('/api/score/', methods=['GET']) def get_score(student_id): # 假设这里是从数据库获取数据 scores = {"1001": [90, 85, 92], "1002": [78, 80, 75]} return jsonify({"student_id": student_id, "scores": scores.get(student_id)})
import React, { useState, useEffect } from 'react'; function ScoreQuery() { const [studentId, setStudentId] = useState(''); const [scores, setScores] = useState(null); useEffect(() => { fetch(`/api/score/${studentId}`) .then(response => response.json()) .then(data => setScores(data.scores)); }, [studentId]); return (setStudentId(e.target.value)} /> {scores && Scores: {scores.join(', ')}}); }