|
@@ -52,9 +52,11 @@ class Auth
|
|
|
$project = $this->wechat->project();
|
|
|
$param['js_code'] = Dever::input('code');
|
|
|
$param['appid'] = Dever::input('appid');
|
|
|
- //$param['component_access_token'] = $this->wechat->token();
|
|
|
+ $param['component_access_token'] = $this->wechat->token();
|
|
|
$param['component_appid'] = $project['appid'];
|
|
|
- $data = $this->wechat->curl('applet_login', $param);
|
|
|
+ $param['grant_type'] = 'authorization_code';
|
|
|
+ $url = 'https://api.weixin.qq.com/sns/component/jscode2session?' . http_build_query($param);
|
|
|
+ $data = Dever::curl($url);
|
|
|
|
|
|
echo $data;die;
|
|
|
}
|