diff --git a/app-dm/src/TeacherPages/SendTest/SendTest.jsx b/app-dm/src/TeacherPages/SendTest/SendTest.jsx index e4c5d37..3a0979b 100644 --- a/app-dm/src/TeacherPages/SendTest/SendTest.jsx +++ b/app-dm/src/TeacherPages/SendTest/SendTest.jsx @@ -131,7 +131,7 @@ function SendTest(){ } ) alert('发布成功') - window.location.href='http://localhost:3000/teacher/managetest' + window.location.href='http://36.138.114.105:30294/teacher/managetest' }catch{ alert('发布失败') } diff --git a/app-dm/src/TeacherPages/TeacherPage.jsx b/app-dm/src/TeacherPages/TeacherPage.jsx index 0040872..49f2e61 100644 --- a/app-dm/src/TeacherPages/TeacherPage.jsx +++ b/app-dm/src/TeacherPages/TeacherPage.jsx @@ -15,10 +15,10 @@ function TeacherPage() { // const is_login = localStorage.getItem('islogin'); // if (!is_login) { // alert('未登录'); - // window.location.href = 'http://localhost:3000/signin'; + // window.location.href = 'http://36.138.114.105:30294/signin'; // } else { // if(teacher_ID.length===8){ - // window.location.href='http://localhost:3000' + // window.location.href='http://36.138.114.105:30294' // return // }else{ // console.log(teacher_ID); diff --git a/app-dm/src/nav/nav.jsx b/app-dm/src/nav/nav.jsx index b967438..a776bbe 100644 --- a/app-dm/src/nav/nav.jsx +++ b/app-dm/src/nav/nav.jsx @@ -15,7 +15,7 @@ function HeaderNav() { localStorage.removeItem('islogin') // setisChecked(false) alert('注销成功') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/signin' }; const [isChecked,setisChecked]=useState(false) diff --git a/app-dm/src/nav/teacherIndex.jsx b/app-dm/src/nav/teacherIndex.jsx index 3b679da..5e92099 100644 --- a/app-dm/src/nav/teacherIndex.jsx +++ b/app-dm/src/nav/teacherIndex.jsx @@ -15,7 +15,7 @@ function HeaderNavTeacher() { localStorage.removeItem('islogin') // setisChecked(false) alert('注销成功') - window.location.href='http://localhost:3000/signin' + window.location.href='http://36.138.114.105:30294/signin' }; const [isChecked,setisChecked]=useState(false) diff --git a/app-dm/src/pages/ListPages/Subject/Exam.jsx b/app-dm/src/pages/ListPages/Subject/Exam.jsx index dcf600b..a622651 100644 --- a/app-dm/src/pages/ListPages/Subject/Exam.jsx +++ b/app-dm/src/pages/ListPages/Subject/Exam.jsx @@ -137,11 +137,10 @@ function Exam(){ score, examId }) - console.log('能不能发送'); }catch(error){ alert(error) } - window.location.href='http://localhost:3000/subject' + window.location.href='http://36.138.114.105:30294/subject' } score_func() }else{ diff --git a/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx b/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx index 98ca920..dd45ad0 100644 --- a/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx +++ b/app-dm/src/pages/ListPages/Subject/SubjectPage.jsx @@ -20,7 +20,7 @@ function SubjectPage(){ const test_src= await axios.post('/api/student/get_test',{student_ID}) settestdata(test_src.data['data']) }catch(error){ - alert(error) + alert('test出错') } } useEffect(()=>{ diff --git a/app-dm/src/pages/ListPages/Training/TrainingPage.css b/app-dm/src/pages/ListPages/Training/TrainingPage.css index 201b1f0..e2eed3f 100644 --- a/app-dm/src/pages/ListPages/Training/TrainingPage.css +++ b/app-dm/src/pages/ListPages/Training/TrainingPage.css @@ -73,7 +73,7 @@ color: red; font-size: 20px; margin-top: 350px; - margin-left: 50px; + margin-left: 70px; letter-spacing: 20px; } diff --git a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx index aa21fc9..9ff46e9 100644 --- a/app-dm/src/pages/ListPages/Training/TrainingPage.jsx +++ b/app-dm/src/pages/ListPages/Training/TrainingPage.jsx @@ -15,7 +15,7 @@ function SubjectPage(){ // 获取实训标题 const FetchTrainFunc=async()=>{ try{ - const FetchTrainSrc=await axios.post('http://127.0.0.1:5000/student/FetchTrainTitle',{ + const FetchTrainSrc=await axios.post('api/student/FetchTrainTitle',{ student_ID }) setTitle(FetchTrainSrc.data['title']) diff --git a/app-dm/src/pages/SignIn/SignInPage.jsx b/app-dm/src/pages/SignIn/SignInPage.jsx index ec1594b..c956eeb 100644 --- a/app-dm/src/pages/SignIn/SignInPage.jsx +++ b/app-dm/src/pages/SignIn/SignInPage.jsx @@ -21,11 +21,11 @@ function SignInPage(){ if (data.result === '登录成功' && data.user==='user'){ localStorage.setItem('islogin',ID) alert('用户登录成功') - window.location.href='http://localhost:3000'//后期改成学生页面 + window.location.href='http://36.138.114.105:30294'//后期改成学生页面 }else if(data.result==='登录成功'&&data.user==='teacher'){ localStorage.setItem('islogin',ID) alert('教师登录成功') - window.location.href='http://localhost:3000/teacher'//后期改成老师页面 + window.location.href='http://36.138.114.105:30294/teacher'//后期改成老师页面 }else{ alert('账号或密码错误') setID('') diff --git a/python/app.py b/python/app.py index 15aa22e..450905e 100644 --- a/python/app.py +++ b/python/app.py @@ -22,8 +22,6 @@ def login(): login_data = request.json # 获取前端发送过来的数据 ID = login_data['ID'] # 解析数据 password = login_data['password'] - print(ID) - print(password) if len(ID) == 8: # 根据长度判断,长度为十则是学生 try: en_password, password = student_login_func(ID, password) @@ -128,7 +126,7 @@ def score_entry(): return jsonify({'result': '成功'}) -@app.route('/student/FetchTrainTitle',methods=['POST']) +@app.route('/api/student/FetchTrainTitle',methods=['POST']) def FetchTrainTitle(): data = request.json ID = data['student_ID'] diff --git a/python/student_func.py b/python/student_func.py index 2b2ebce..a76c6fc 100644 --- a/python/student_func.py +++ b/python/student_func.py @@ -205,16 +205,15 @@ def score_entry_func(score,testID,ID): def FetchTrainTitleFunc(ID): cursor = db.cursor() - cursor.execute('SELECT * FROM TRAINSCORE WHERE STUDENT_ID=?',(ID)) + cursor.execute("SELECT * FROM TRAINSCORE WHERE STUDENT_ID=? and TF='false'",(ID)) train_title = cursor.fetchall() titles = [] title = [] for i in train_title: titles.append(i[2]) - print(titles) for i in titles: - cursor.execute('select * from TRAINTEST WHERE ID=?',(i)) + cursor.execute('SELECT * FROM TRAINTEST WHERE ID=? ',(i)) title.append(cursor.fetchall()) cursor.close()