wechat_auth_url . '?' . http_build_query([ 'appid' => $this->appid, 'secret' => $this->secret, 'js_code' => $code, 'grant_type' => 'authorization_code' ]); $result = Curl::get($url); $res = $this->userExternalService->wechatNewUser($result['data']['openid']); if (!$res['code'] !== 200) { throw new BusinessException($res['code'], $res['msg']); } return ['openid' => $result['data']['openid']]; } }