链接更改

This commit is contained in:
30404 2024-06-20 15:30:16 +08:00
parent 045454f023
commit eacc60ea86
11 changed files with 14 additions and 18 deletions

View File

@ -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('发布失败')
}

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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{

View File

@ -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(()=>{

View File

@ -73,7 +73,7 @@
color: red;
font-size: 20px;
margin-top: 350px;
margin-left: 50px;
margin-left: 70px;
letter-spacing: 20px;
}

View File

@ -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'])

View File

@ -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('')

View File

@ -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']

View File

@ -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()