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

微信公众号消息加解密方式‘兼容模式’也需要填写‘aes_key’参数,不能为空 #967

Closed
AuroraLZDF opened this issue Oct 20, 2017 · 0 comments

Comments

@AuroraLZDF
Copy link

我用的环境

PHP 版本:7.1
overtrue/wechat 版本:3.1.10
是否使用了框架?框架名称:laravel

问题及现象

问题:今天测试了laravel-WeChat,token获取正常,但是不能自动回复

代码:

Log::info('Log Message', ['context' => 'start']); # 注意:Log 为 Laravel 组件

        $options = config('wechat');
        $app = new Application($options);
        $server = $app->server;

        $server->setMessageHandler(function ($message) {
            return "您好!欢迎关注我!";
        });

        Log::info('Log Message', ['context' => json_encode($server)]);

日志提示信息:

[2017-10-21 00:11:17] production.INFO: Log Message {"context":"start"} 
[2017-10-21 00:11:17] production.INFO: Log Message {"context":"{}"} 
[2017-10-21 00:11:17] production.ERROR: Configuration mission, 'aes_key' is required. {"exception":"[object] (EasyWeChat\\Encryption\\EncryptionException(code: -40007): Configuration mission, 'aes_key' is required. at /home/www/aurora/vendor/overtrue/wechat/src/Encryption/Encryptor.php:264)

我的公众号加密方式为‘兼容模式’(不会放图片)

而文档中说的是在‘安全模式’下才必须填写‘aes_key’,导致浪费了不少时间(也怪自己太粗心吧)。建议文档标注一下,谢谢。

@AuroraLZDF AuroraLZDF changed the title laravel5.5 兼容模式也需要填写‘aes_key’参数,不能为空 微信公众号消息加解密方式‘兼容模式’也需要填写‘aes_key’参数,不能为空 Oct 20, 2017
overtrue added a commit to EasyWeChat/docs that referenced this issue Oct 22, 2017
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

1 participant