Skip to content

laravel框架微信发送的Token验证失败问题 #318

Closed
@linjin101

Description

@linjin101

Token验证失败:
必须添加ob_end_clean(); //必须清空缓冲区
这样微信才能通过。。。
不知道什么原因????

public function serve()
{
Log::info('request arrived.'); # 注意:Log 为 Laravel 组件,所以它记的日志去 Laravel 日志看,而不是 EasyWeChat 日志

    $app = app('wechat.official_account');
    $app->server->push(function($message){
        return "欢迎关注普育吧!";
    });
    ob_end_clean(); //必须清空缓冲区
    return $app->server->serve();
}

Activity

chjw8016

chjw8016 commented on Jul 12, 2019

@chjw8016

如果配置了laravel-debugbar,也会导致Token验证失败

tkwong94

tkwong94 commented on Jul 12, 2019

@tkwong94

如果配置了laravel-debugbar,也会导致Token验证失败

  1. specify the env variable to disable debugbar, i.e. APP_DEBUG=true, OR
  2. add 'wechat' into the except array inside debugbar config file (debugbar.php)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @overtrue@linjin101@chjw8016@tkwong94

        Issue actions

          laravel框架微信发送的Token验证失败问题 · Issue #318 · overtrue/laravel-wechat