diff --git a/api/auth/login.php b/api/auth/login.php new file mode 100644 index 0000000..9a3982a --- /dev/null +++ b/api/auth/login.php @@ -0,0 +1,57 @@ +password)) { + // 编译数据 + $data = array( + 'output'=>'SUCCESS', + 'code'=>200, + 'info'=>'密码正确', + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + } else { + // 编译数据 + $data = array( + 'output'=>'PASSWORD_DENY', + 'code'=>403, + 'info'=>'密码错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } +} else { + // 编译数据 + $data = array( + 'output'=>'KEY_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/get_book/change.php b/api/get_book/change.php index 5b64207..1e379fd 100644 --- a/api/get_book/change.php +++ b/api/get_book/change.php @@ -15,7 +15,6 @@ $time = date("Y-m-d H:i:s"); // 构建函数 if ($key == $setting['Key']) { // 对数据表进行检查 - // 对数据表进行写入操作 mysqli_query($conn,"LOCK TABLE ".$setting['SQL_DATA']['book']." WRITE"); $result_book_person = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['book']." WHERE s_ID='$student'");