-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PC端扫描登录的问题 #930
Comments
//由于目前只做登录验证,所以token与aes_key 未配置 |
开放平台第三方平台和开放平台网站应用是不同的
|
你要用 PC 扫码登录的直接用 overtrue/socialite 即可 |
如果使用中间件模式 //微信端登录 怎么修改配置项呢 |
@crisslin 这个 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我用的环境
PHP 版本:7.1
overtrue/wechat 版本:最新
是否使用了框架?框架名称:laravel
问题及现象
使用easywechat实现PC端扫描微信登录,使用中间件'wechat.oauth:snsapi_login',显示appid不正确,因为easywechat 默认读取 wechat.php配置文件中appid的值,而不去读取open_platform配置项的值,按道理来说,scope就限定了读取不同的配置方案。
snsapi_login 应该读取第三方平台的值
snsapi_userinfo和snsapi_base 应该读取微信公众号的appid等值
路由中使用中间件
代码:
//pc端微信扫码登录
Route::group(['middleware' => ['web', 'wechat.oauth:snsapi_login']], function () {}
//微信端登录
Route::group(['middleware' => ['web', 'wechat.oauth:snsapi_userinfo']], function () {}
=================================
wechat.php配置文件
/*
* 账号基本信息,请从微信公众平台/开放平台获取
/
'app_id' => env('WECHAT_APPID', '已填'), // AppID
'secret' => env('WECHAT_SECRET', '已填*'), // AppSecret
'token' => env('WECHAT_TOKEN', 'your-token'), // Token
'aes_key' => env('WECHAT_AES_KEY', ''), // EncodingAESKey
//由于值做登录验证,所以token与aes_key 未配置
The text was updated successfully, but these errors were encountered: