| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 | <?php# wechat基本配置# 第一步 请求$config['auth'] = array(	'url' => 'https://open.weixin.qq.com/connect/oauth2/authorize',	'param' => array	(		'appid' => '',		'redirect_uri' => '',		# 重命名,如果key不是response_type的话		//'response_type' => array('response_type', 'code'),		'response_type' => 'code',		'scope' => 'snsapi_userinfo',		'state' => '',		//'contact' => '#wechat_redirect',	));# 第二步 获取token$config['token'] = array(	'url' => 'https://api.weixin.qq.com/sns/oauth2/access_token',	'param' => array	(		'appid' => '',		'secret' => '',		'code' => '',		'grant_type' => 'authorization_code',	),	'response' => array	(		'access_token' => '',		'expires_in' => '',		'refresh_token' => '',		'openid' => '',		'unionid' => '',		'scope' => '',		'errcode' => '',		'errmsg' => '',	));# 第三步 获取用户信息$config['user'] = array(	'url' => 'https://api.weixin.qq.com/sns/oauth2/access_token',	'param' => array	(		'appid' => 'appid',		'secret' => 'secret',		'code' => 'code',		'grant_type' => 'authorization_code',	));return $config;
 |