有人遇到过 Swoft 接入 EasyWechat 扩展,微信验证服务端 token 失败问题吗?
我用的环境#
- PHP 版本:7.2
- overtrue/wechat 版本:4.1
- Swoole 版本:4.4.3
- Swoole 框架名称: Swoft2.0.5
问题及现象#
微信公众号监听用户关注事件,微信公众号后台需要验证服务器端 tokenswoft
框架不能使用 exit
, 文档中说 $response->send()
直接输出(echo)了,请问用 swoft
的方式怎么去做
WeChatController
$config=[
....
];
$app = Factory::officialAccount($config);
$response = $app->server->serve();
return \context()->getResponse()
->withContentType('text/xml')
->withContent($response->getContent());
求助中
推荐文章: