$state = md5(uniqid(rand(), true));
// 构建微信快捷登录授权URL
// 微信快捷登录通常使用H5授权页面,而不是扫码登录
$authParams = [
'appid' => $wechatConfig['app_id'],
'redirect_uri' => $wechatConfig['redirect_uri'],
'response_type' => 'code',
'scope' => $wechatConfig['scope'],
'state' => $state
];
// 构建快捷登录授权URL
$authUrl = $wechatConfig['auth_url'] . '?' . http_build_query($authParams) . '#wechat_redirect';
配置如下
// 微信开放平台回调URL
'redirect_uri' => urlencode('https://api.moqu.net.cn'),
// 微信支付异步回调URL
'notify_url' => urlencode('https://api.moqu.net.cn/wechatPay.php'),
// 微信开放平台授权范围
'scope' => 'snsapi_login',
// 微信开放平台授权URL
'auth_url' => 'https://open.weixin.qq.com/connect/qrconnect',
// 微信API获取access_token的URL
'access_token_url' => 'https://api.weixin.qq.com/sns/oauth2/access_token',
// 微信API获取用户信息的URL
'user_info_url' => 'https://api.weixin.qq.com/sns/userinfo',
// 微信支付网关URL
'gateway_url' => 'https://api.mch.weixin.qq.com'

url编码两次了
url encode两次做什么呢
前端网址:
https://fonts.moqu.net.cn/pages/login.html#