Skip to content
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

服务器token验证 #32

Closed
stevejobsii opened this issue Apr 30, 2016 · 3 comments
Closed

服务器token验证 #32

stevejobsii opened this issue Apr 30, 2016 · 3 comments

Comments

@stevejobsii
Copy link

我的控制器:
public function serve()
{
Log::info('request arrived.'); # 注意:Log 为 Laravel 组件,所以它记的日志去 Laravel 日志看,而不是 EasyWeChat 日志
$wechat = app('wechat');
//return $wechat;
app('wechat')->server->setMessageHandler(function($message){
return "欢迎关注 overtrue!";
});
Log::info('return response.');
return app('wechat')->server->serve();
}
我的route:Route::any('/weixin', 'WeixinController@serve');
我的middle:
protected $except = [
'weixin',
];
我的报告:BadRequestException in Guard.php line 317:
Invalid request.
我的日记:所有参数key,id等传输正确
腾讯验证:token验证错误

@overtrue
Copy link
Owner

overtrue commented May 1, 2016

public function serve()
{
    Log::info('request arrived.'); 
    $server = app('wechat')->server;

    $server->setMessageHandler(function($message){
        return "欢迎关注 overtrue!";
    });
    Log::info('return response.');
    return $server->serve();
}

然后看日志。

@stevejobsii
Copy link
Author

感谢!原来是routes.php的<?php前面多了个空格,谢谢!

@YangEndly
Copy link

YangEndly commented Mar 25, 2017

我的也是这个问题,日志 是这样的
local 信息 14:47:08
return response.
local 信息 14:47:08
request arrived.

https://forum.easywechat.org/d/180-token 具体信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants