diff --git a/plugin/admin/app/controller/StudentController.php b/plugin/admin/app/controller/StudentController.php index f96cbe3..f6369f9 100644 --- a/plugin/admin/app/controller/StudentController.php +++ b/plugin/admin/app/controller/StudentController.php @@ -97,6 +97,10 @@ class StudentController extends Crud $request_data = $request->post(); $salt = random_str(16); + + if (check_chinese_chars($request_data['account'])){ + throw new Exception('账号中不能包含中文'); + } if (empty($request_data['password'])) { $password = trim(explode(' ', $request_data['account'])[0]) . '001'; $password = md5($password . $salt); @@ -141,8 +145,8 @@ class StudentController extends Crud throw new Exception('未找到学生信息,操作失败'); } - if (check_chinese_chars($request_data['student_name'])){ - throw new Exception('名字中不能包含中文'); + if (check_chinese_chars($request_data['account'])){ + throw new Exception('账号中不能包含中文'); } if (empty($request_data['password'])) { @@ -385,8 +389,8 @@ class StudentController extends Crud $account = trim($currSheet->getCell('A' . $row)->getValue() ?: ''); $student_name = trim($currSheet->getCell('B' . $row)->getValue() ?: ''); - if(check_chinese_chars($student_name)){ - $check_msg .= '【'+ $student_name +'】'; + if(check_chinese_chars($account)){ + $check_msg .= '【'+ $account +'】'; } if ($account && $student_name) {