收藏
回答

【求助】网站应用出现redirect_uri 参数错误,域名还有参数都配置对了?

https://open.weixin.qq.com/connect/qrconnect?appid=xxxxxxxxxxx&redirect_uri=https%253A%252F%252Fapi.moqu.net.cn&response_type=code&scope=snsapi_login&state=cafe1f8ea71f68d601bd05fde06e79f1#wechat_redirect

       $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'
回答关注问题邀请回答
收藏

4 个回答

  • hello world
    hello world
    01-26

    url编码两次了

    01-26
    有用
    回复
  • Mr.Zhao
    Mr.Zhao
    01-25

    url encode两次做什么呢

    01-25
    有用
    回复
  • 智能回答 智能回答 本次回答由AI生成
    01-25
    有用
  • 他和他的狗
    他和他的狗
    01-25

    前端网址:

    https://fonts.moqu.net.cn/pages/login.html#

    01-25
    有用
    回复
登录 后发表内容