diff --git a/app/api/controller/WxServer.php b/app/api/controller/WxServer.php new file mode 100644 index 00000000..8a83d937 --- /dev/null +++ b/app/api/controller/WxServer.php @@ -0,0 +1,33 @@ +renderSuccess('访问成功'); + } + + public function verifyTicket() + { + $data = $this->request->post(); + $xmlData = file_get_contents("php://input"); // 获取原始的XML数据 + // 解析XML数据 +// $xml = simplexml_load_string($xmlData, 'SimpleXMLElement', LIBXML_NOCDATA); +// $fromUser = $xml->FromUserName; +// $toUser = $xml->ToUserName; +// $content = $xml->Content; + if ($xmlData) { + Db::table('yoshop_wx_server')->insertGetId(['content' => $xmlData, 'created_at' => date('Y-m-d H:i:s')]); + } + if ($data) { + Db::table('yoshop_wx_server')->insertGetId(['content' => $data, 'created_at' => date('Y-m-d H:i:s')]); + } + echo 'success'; + } +} \ No newline at end of file