-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
接入微信后台的客服api
route/api.php
$router->any('wechat/serve', 'WechatMiniCustomerController@serve');控制器方法
public function serve() : Response
{
$app = $this->getMiniProgram();
$customerService = $app->customer_service;
$app->server->push(static function ($message) use ($customerService) {
if (isset($message['MsgType']) && 'miniprogrampage' === $message['MsgType']) {
if ('type=map' === $message['PagePath']) {
$text = new Text(AirdropConstant::CUSTOMER_INTRO_TEXT);
$customerService->message($text)->to($message['FromUserName'])->send();
}
$link = new Link(AirdropConstant::APP_INFO[$message['PagePath']]);
$customerService->message($link)->to($message['FromUserName'])->send();
}
});
return $app->server->serve();
}在转发给客服后, 客户端收到消息延迟或者接收不到或者在一段时间后, 会收到好多条.
替换为支持协程的Guzzle Handler后, 也会有这些问题.
PHP-FPM下是正常的.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels