Replies: 1 comment 4 replies
-
建议把你的代码贴全一些,否则没法判断
weiconto ***@***.***>于2022年7月19日 周二09:27写道:
… 不知道是我的使用有问题还是确实如此。
框架:ThinkPHP 6.0
easywechat 版本:6.7.2
PHP 版本:8.1.2
问题:企业微信自建应用,接收企业微信回调,发现无法获取企业微信回调的数据(验证是通过,但无法获取到企业微信发送来的数据)。
调用方法:
$server->getDecryptedMessage();
和
$server->with(function($message, \Closure $next) {
file_put_contents('debug.log', json_encode($message)); return
$next($message); });
这两种方式都无法获取和解析企业微信发送过来的数据。
怀疑可能是无法获取企业微信发送过来的 xml 数据导致的。
在 windows (nginx1.15.9+php8.1.2),和 centos7(nginx1.20.1+php8.1.7)都是如此。
最后是自行简陋实现,发现是没问题的:
// $this->request ThinkPHP6 request 对象 $input =
$this->request->getInput(); $xml = new Xml(); $data = $xml->parse($input);
// $this->request ThinkPHP6 request 对象 $query = $this->request->get();
$encryptor = new \EasyWeChat\Kernel\Encryptor( $config['corp_id'],
$config['token'], $config['encoding_aes_key']); $message =
$encryptor->decrypt($data['Encrypt'], $query['msg_signature'],
$query['nonce'], $query['timestamp']); $message = $xml->parse($message);
请问是我调用的不对吗?还是什么其他原因?
—
Reply to this email directly, view it on GitHub
<#2544>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALHOYCGYXRWYJKTHW375TLVUYAAFANCNFSM536IHYGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
不知道是我的使用有问题还是确实如此。
框架:ThinkPHP 6.0
easywechat 版本:6.7.2
PHP 版本:8.1.2
问题:企业微信自建应用,接收企业微信回调,发现无法获取企业微信回调的数据(验证是通过,但无法获取到企业微信发送来的数据)。
调用方法:
和
这两种方式都无法获取和解析企业微信发送过来的数据。
怀疑可能是无法获取企业微信发送过来的 xml 数据导致的。
在 windows (nginx1.15.9+php8.1.2),和 centos7(nginx1.20.1+php8.1.7)都是如此。
最后是自行简陋实现,发现是没问题的:
请问是我调用的不对吗?还是什么其他原因?
Beta Was this translation helpful? Give feedback.
All reactions