微信开放平台 - PHP微信登录授权问题
伊谢尔伦
伊谢尔伦 2017-04-10 16:13:30
0
5
696

关于登录授权问题,我index.php中代码
header('location:https://open.weixin.qq.com/connect/oauth2/authorize?appid=我的appid&redirect_uri=192.168.1.127%2foauth2.php&response_type=code&scope=snsapi_login&state=1#wechat_redirect');
然后在微信中打开192.168.1.127,根据代码会跳转到微信授权页面,授权成功后按照我的理解应该会跳转到192.168.1.127/oauth.php&code=xxxxxx&state=xxx,但是没有跳转过去,而是跳转到
https://open.weixin.qq.com/connect/oauth2/192.168.1.127/oauth.php?code...;问下这是怎么回事呢?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

répondre à tous(5)
大家讲道理

redirect_uri 应该需要带 scheme, http://example.com/foo.php

伊谢尔伦

在微信公众号请求用户网页授权之前,开发者需要先到公众平台官网中的开发者中心页配置授权回调域名。请注意,这里填写的是域名(是一个字符串),而不是URL,因此请勿加http://等协议头;----微信开发文档关于网页授权回调域名的说明的第一条

大家讲道理

你的回调地址没有加 http://

回调地址请使用标准的 URL 地址:http(s)://subdomain.domain.com/segment1/setment2/setmentn...

大家讲道理
  1. redirect_uri 应该需要带 scheme, http://www.example.com/auth.php

  2. 需要在公众平台 开发者中心配置网页授权的域名,注意这里的域名就是上面的example.com

大家讲道理

不能用ip...

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!