-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用$server->getMessage();报错 #712
Comments
请不要使用浏览器来访问,这个东西是给微信服务器来调用的。 |
不是浏览器访问的,是我写在微信接口中的一个监听事件里面了,用来存储用户发送的消息时调用的,就报错了 |
那就是你的 Nginx 配置有问题了,query 部分丢了 |
laravel 的 nginx 文件该怎么配置,能提供一下完整样例嘛,这个虽然报错但是还是可以正常运行的。 |
location / {
try_files $uri $uri/ /index.php?$query_string;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我用的环境
PHP 版本:
overtrue/wechat 版本:
问题及现象
我打算用事件存储微信发送的消息,把
new Application($this->options)
实例传入了事件中,在监听里面打印用户发送的消息public function handle(WechatMessageEvent $event)
{
$server = $event->wechat->server;
// 获取数组类型的 微信接口发送数据
$message = $server->getMessage();
Log::info($message['Content']);
}
$message = $server->getMessage();
,使用时虽然数据能正常获取到但是会写日志一个errorEasyWeChat\Server\BadRequestException: Invalid request. in /home/wwwroot/wechat_admin/vendor/overtrue/wechat/src/Server/Guard.php:343
#0 /home/wwwroot/wechat_admin/app/Listeners/WechatMessageListener.php(34): EasyWeChat\Server\Guard->getMessage()
#1 [internal function]: App\Listeners\WechatMessageListener->handle(Object(App\Events\WechatMessageEvent))
The text was updated successfully, but these errors were encountered: