新版easywechat 获取手机号
/**
* 绑定手机号
* @param Request $request
* @return JsonResponse
* @throws TransportExceptionInterface
*/public function bindPhone(Request $request): JsonResponse
{
$code = $request->input('code');
$app = EasyWeChat::miniApp();
$data = $app->getClient()->postJson('wxa/business/getuserphonenumber', ['code' => $code]);
return $this->success($data);
}
我这样拿到的$data是个空对象 不知道哪里出了问题也不报错 是哪里写错了吗 还是没有配置
推荐文章: