链接更改
This commit is contained in:
parent
045454f023
commit
eacc60ea86
|
@ -131,7 +131,7 @@ function SendTest(){
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
alert('发布成功')
|
alert('发布成功')
|
||||||
window.location.href='http://localhost:3000/teacher/managetest'
|
window.location.href='http://36.138.114.105:30294/teacher/managetest'
|
||||||
}catch{
|
}catch{
|
||||||
alert('发布失败')
|
alert('发布失败')
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,10 @@ function TeacherPage() {
|
||||||
// const is_login = localStorage.getItem('islogin');
|
// const is_login = localStorage.getItem('islogin');
|
||||||
// if (!is_login) {
|
// if (!is_login) {
|
||||||
// alert('未登录');
|
// alert('未登录');
|
||||||
// window.location.href = 'http://localhost:3000/signin';
|
// window.location.href = 'http://36.138.114.105:30294/signin';
|
||||||
// } else {
|
// } else {
|
||||||
// if(teacher_ID.length===8){
|
// if(teacher_ID.length===8){
|
||||||
// window.location.href='http://localhost:3000'
|
// window.location.href='http://36.138.114.105:30294'
|
||||||
// return
|
// return
|
||||||
// }else{
|
// }else{
|
||||||
// console.log(teacher_ID);
|
// console.log(teacher_ID);
|
||||||
|
|
|
@ -15,7 +15,7 @@ function HeaderNav() {
|
||||||
localStorage.removeItem('islogin')
|
localStorage.removeItem('islogin')
|
||||||
// setisChecked(false)
|
// setisChecked(false)
|
||||||
alert('注销成功')
|
alert('注销成功')
|
||||||
window.location.href='http://localhost:3000/signin'
|
window.location.href='http://36.138.114.105:30294/signin'
|
||||||
};
|
};
|
||||||
|
|
||||||
const [isChecked,setisChecked]=useState(false)
|
const [isChecked,setisChecked]=useState(false)
|
||||||
|
|
|
@ -15,7 +15,7 @@ function HeaderNavTeacher() {
|
||||||
localStorage.removeItem('islogin')
|
localStorage.removeItem('islogin')
|
||||||
// setisChecked(false)
|
// setisChecked(false)
|
||||||
alert('注销成功')
|
alert('注销成功')
|
||||||
window.location.href='http://localhost:3000/signin'
|
window.location.href='http://36.138.114.105:30294/signin'
|
||||||
};
|
};
|
||||||
|
|
||||||
const [isChecked,setisChecked]=useState(false)
|
const [isChecked,setisChecked]=useState(false)
|
||||||
|
|
|
@ -137,11 +137,10 @@ function Exam(){
|
||||||
score,
|
score,
|
||||||
examId
|
examId
|
||||||
})
|
})
|
||||||
console.log('能不能发送');
|
|
||||||
}catch(error){
|
}catch(error){
|
||||||
alert(error)
|
alert(error)
|
||||||
}
|
}
|
||||||
window.location.href='http://localhost:3000/subject'
|
window.location.href='http://36.138.114.105:30294/subject'
|
||||||
}
|
}
|
||||||
score_func()
|
score_func()
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -20,7 +20,7 @@ function SubjectPage(){
|
||||||
const test_src= await axios.post('/api/student/get_test',{student_ID})
|
const test_src= await axios.post('/api/student/get_test',{student_ID})
|
||||||
settestdata(test_src.data['data'])
|
settestdata(test_src.data['data'])
|
||||||
}catch(error){
|
}catch(error){
|
||||||
alert(error)
|
alert('test出错')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
color: red;
|
color: red;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin-top: 350px;
|
margin-top: 350px;
|
||||||
margin-left: 50px;
|
margin-left: 70px;
|
||||||
letter-spacing: 20px;
|
letter-spacing: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ function SubjectPage(){
|
||||||
// 获取实训标题
|
// 获取实训标题
|
||||||
const FetchTrainFunc=async()=>{
|
const FetchTrainFunc=async()=>{
|
||||||
try{
|
try{
|
||||||
const FetchTrainSrc=await axios.post('http://127.0.0.1:5000/student/FetchTrainTitle',{
|
const FetchTrainSrc=await axios.post('api/student/FetchTrainTitle',{
|
||||||
student_ID
|
student_ID
|
||||||
})
|
})
|
||||||
setTitle(FetchTrainSrc.data['title'])
|
setTitle(FetchTrainSrc.data['title'])
|
||||||
|
|
|
@ -21,11 +21,11 @@ function SignInPage(){
|
||||||
if (data.result === '登录成功' && data.user==='user'){
|
if (data.result === '登录成功' && data.user==='user'){
|
||||||
localStorage.setItem('islogin',ID)
|
localStorage.setItem('islogin',ID)
|
||||||
alert('用户登录成功')
|
alert('用户登录成功')
|
||||||
window.location.href='http://localhost:3000'//后期改成学生页面
|
window.location.href='http://36.138.114.105:30294'//后期改成学生页面
|
||||||
}else if(data.result==='登录成功'&&data.user==='teacher'){
|
}else if(data.result==='登录成功'&&data.user==='teacher'){
|
||||||
localStorage.setItem('islogin',ID)
|
localStorage.setItem('islogin',ID)
|
||||||
alert('教师登录成功')
|
alert('教师登录成功')
|
||||||
window.location.href='http://localhost:3000/teacher'//后期改成老师页面
|
window.location.href='http://36.138.114.105:30294/teacher'//后期改成老师页面
|
||||||
}else{
|
}else{
|
||||||
alert('账号或密码错误')
|
alert('账号或密码错误')
|
||||||
setID('')
|
setID('')
|
||||||
|
|
|
@ -22,8 +22,6 @@ def login():
|
||||||
login_data = request.json # 获取前端发送过来的数据
|
login_data = request.json # 获取前端发送过来的数据
|
||||||
ID = login_data['ID'] # 解析数据
|
ID = login_data['ID'] # 解析数据
|
||||||
password = login_data['password']
|
password = login_data['password']
|
||||||
print(ID)
|
|
||||||
print(password)
|
|
||||||
if len(ID) == 8: # 根据长度判断,长度为十则是学生
|
if len(ID) == 8: # 根据长度判断,长度为十则是学生
|
||||||
try:
|
try:
|
||||||
en_password, password = student_login_func(ID, password)
|
en_password, password = student_login_func(ID, password)
|
||||||
|
@ -128,7 +126,7 @@ def score_entry():
|
||||||
return jsonify({'result': '成功'})
|
return jsonify({'result': '成功'})
|
||||||
|
|
||||||
|
|
||||||
@app.route('/student/FetchTrainTitle',methods=['POST'])
|
@app.route('/api/student/FetchTrainTitle',methods=['POST'])
|
||||||
def FetchTrainTitle():
|
def FetchTrainTitle():
|
||||||
data = request.json
|
data = request.json
|
||||||
ID = data['student_ID']
|
ID = data['student_ID']
|
||||||
|
|
|
@ -205,16 +205,15 @@ def score_entry_func(score,testID,ID):
|
||||||
|
|
||||||
def FetchTrainTitleFunc(ID):
|
def FetchTrainTitleFunc(ID):
|
||||||
cursor = db.cursor()
|
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()
|
train_title = cursor.fetchall()
|
||||||
titles = []
|
titles = []
|
||||||
title = []
|
title = []
|
||||||
for i in train_title:
|
for i in train_title:
|
||||||
titles.append(i[2])
|
titles.append(i[2])
|
||||||
print(titles)
|
|
||||||
|
|
||||||
for i in 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())
|
title.append(cursor.fetchall())
|
||||||
|
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
Loading…
Reference in New Issue