diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..e69de29 diff --git a/api/auth/changepassword.php b/api/auth/changepassword.php new file mode 100644 index 0000000..e69de29 diff --git a/api/class/info_change.php b/api/class/info_change.php new file mode 100644 index 0000000..297e67d --- /dev/null +++ b/api/class/info_change.php @@ -0,0 +1,150 @@ +'DATA_QQ', + 'code'=>403, + 'info'=>'参数 Json[data.person_qq] 错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } + } + + // 上传数据(保证数据可以正常上传则锁定数据库) + mysqli_query($conn,"LOCK TABLE ".$setting['SQL_DATA']['info']." WHRITE"); + if (mysqli_query($conn,"UPDATE ".$setting['SQL_DATA']['info']." SET displayname='$data_person_displayname',qq='$data_person_qq',city='$data_person_city' WHERE studentID='$data_person'")) { + // 编译数据 + $data = array( + 'output'=>'SUCCESS', + 'code'=>200, + 'info'=>'修改完毕!' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + } else { + // 编译数据 + $data = array( + 'output'=>'MYSQL_ERROR', + 'code'=>403, + 'info'=>'请重试或联系管理员' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } + mysqli_query($conn,"TABLE UNLOCK"); + } else { + if (!preg_match('/[0-9]{8}/',$data_person)) { + // 编译数据 + $data = array( + 'output'=>'DATA_USER', + 'code'=>403, + 'info'=>'参数 Json[data.studentID] 错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } elseif (!preg_match('/^[\x{4e00}-\x{9fa5}A-Za-z0-9_]{2,20}+$/u',$data_person_displayname)) { + // 编译数据 + $data = array( + 'output'=>'DATA_DISPLAYNAME', + 'code'=>403, + 'info'=>'参数 Json[data.person_displayname] 错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } + } + } else { + if (empty($data_person)) { + // 编译数据 + $data = array( + 'output'=>'NONE_USER', + 'code'=>403, + 'info'=>'参数 Json[data.studentID] 缺失' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } elseif ($data_person_displayname) { + // 编译数据 + $data = array( + 'output'=>'NONE_DISPLAYNAME', + 'code'=>403, + 'info'=>'参数 Json[data.person_displayname] 缺失' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } elseif ($data_person_city) { + // 编译数据 + $data = array( + 'output'=>'NONE_CITY', + 'code'=>403, + 'info'=>'参数 Json[data.person_city] 缺失' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } else { + // 编译数据 + $data = array( + 'output'=>'NONE_ERROR', + 'code'=>403, + 'info'=>'参数 Json[data.__] 缺失,未知错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } + } +} else { + // 编译数据 + $data = array( + 'output'=>'SSID_ERROR', + 'code'=>403, + 'info'=>'密钥错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); +} \ No newline at end of file diff --git a/api/class/person.php b/api/class/person.php index 17d3650..eff72ec 100644 --- a/api/class/person.php +++ b/api/class/person.php @@ -66,6 +66,9 @@ if ($key == $sql_key) { 'office'=>$result_person_object->office, 'gender'=>$result_person_object->gender, 'qq'=>$result_person_object->qq, + 'displayname'=>$result_person_object->displayname, + 'ssid'=>$result_person_object->ssid, + 'city'=>$result_person_object->city, ) ); // 输出数据 diff --git a/index.php b/index.php index e433269..3258b93 100644 --- a/index.php +++ b/index.php @@ -57,6 +57,9 @@ $member_all = json_decode($member_all,true);
@@ -78,7 +81,7 @@ $member_all = json_decode($member_all,true);学号 | -姓名 | -职位 | -QQ号 | -
---|---|---|---|
- | - | - | - |