修复学生端不可用问题
This commit is contained in:
@@ -393,6 +393,7 @@ include __DIR__ . '/../includes/header.php';
|
||||
async function loadHomework() {
|
||||
try {
|
||||
const res = await apiGet(`/api/student/homework/${STUDENT_ID}`);
|
||||
let html = '';
|
||||
if (res && res.success) {
|
||||
res.data.homework.forEach(record => {
|
||||
const pointsClass = record.points_change > 0 ? 'plus' : 'minus';
|
||||
@@ -410,7 +411,6 @@ include __DIR__ . '/../includes/header.php';
|
||||
if (res.data.homework.length === 0) {
|
||||
html = '<tr><td colspan="5" style="text-align:center;">暂无作业扣分记录</td></tr>';
|
||||
}
|
||||
}
|
||||
document.getElementById('homeworkList').innerHTML = html;
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user