diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a09c56d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.idea diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/server.php b/server.php index c5541bf..c7405fc 100644 --- a/server.php +++ b/server.php @@ -17,17 +17,18 @@ function mylog($msg, $filename='hook_error'){ $http->reload(); return; } - if(empty($request->post['hook'])) { + if(empty($request->post['payload'])) { mylog('hook data empty'); return; } - $data = json_decode($request->post['hook'], true); - if(empty($data)) { + $datas = json_decode($request->post['payload'], true); + if(empty($datas['hook'])) { //错误的数据 mylog('hook no json data'); return; } - if(PASSWORD && $data['password'] != PASSWORD) { + $data = $datas['hook']; + if(PASSWORD && $data['config']['secret'] != PASSWORD) { //密码不匹配 mylog('password error'); return ;