v0.6测试

This commit is contained in:
2026-04-14 19:18:11 +08:00
parent fd3535f884
commit a60ba8352f
23 changed files with 157 additions and 40 deletions

View File

@@ -101,9 +101,17 @@ $_SESSION['real_name'] = $data['real_name'] ?? '';
$_SESSION['role'] = $data['role'] ?? '';
$_SESSION['login_time'] = time();
// 如果是学生,额外设置 student_id(与 user_id 相同)
// 如果是学生,额外设置 student_id
if ($data['user_type'] === 'student') {
$_SESSION['student_id'] = $data['user_id'];
if (empty($data['student_id'])) {
http_response_code(400);
echo json_encode([
'success' => false,
'message' => '学生类型必须提供 student_id'
]);
exit();
}
$_SESSION['student_id'] = $data['student_id'];
}
// 保存 Session