From 398f93dd9e60ea208bc346f995a2fb6c16fb5c35 Mon Sep 17 00:00:00 2001 From: Dai Date: Sat, 18 Jan 2025 15:09:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=99=90=E5=88=B6=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E4=B8=8D=E8=83=BD=E5=8C=85=E5=90=AB=E4=B8=AD?= =?UTF-8?q?=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/admin/app/controller/StudentController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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) {