$app->setCache(new Psr16Cache(new RedisAdapter(Redis::connection()->client())));
这样就会自动存入默认的redis配置中,如果不是默认的,可以在上述connection里面填写自定义的
$data = [
'appid' => $this->miniProgram->getAccount()->getAppId(),
'js_code' => $code,
'grant_type' => 'authorization_code',
'component_appid' => $this->openPlatform->getAccount()->getAppId(),
'component_access_token' => $this->openPlatform->getComponentAccessToken()->getToken()
];
return $this->miniProgram->getClient()->get('sns/component/jscode2session', $data)->toArray();
$config = $app->getUtils()->buildMiniAppConfig($result['prepay_id'], $this->appid, 'RSA'); // 返回数组
微信SDK
文档是5.x的写法,但是我们用的6.x,所以代码有些调整
$app->rebind('request', $symfony_request);
//上面代码改为这个
$app->setRequestFromSymfonyRequest($symfony_request);
这样就可以顺利的拿到message了
棒棒的,我刚研究webman+easywechat6.x 上来就报错了,研究半天没整明白吗,哎。头疼
感谢分享