zhiqueen

1112 经验值

取之于Laravist,回馈Laravist。return '<hr />' //华丽的分割线一、简介:Laravel Excel 在 Laravel 5 中集成 PHPOffice 套件中的 PHPExcel ,实现导入、导出Excel功能。项目Github:https://github.com/Maatwebsite/Laravel-Excel二、安装 & 配置安装:composer r

所以,现在购买是赠送两个月时长的,Jelly人品很好,也帮所有老用户增加了两个月。

@wei_will_win 超哥说更新了版本,貌似解决了问题,不过我没有试,你可以试试。

@wei_will_win 在.env文件配置
WECHAT_OAUTH_SCOPES=snsapi_userinfo
//下面一行写微信公众平台上开发者配置的URL
WECHAT_OAUTH_CALLBACK=http://www.yuming.com/wechat
然后修改wechat.php,去掉注释

 'oauth' => [
     'scopes'   => array_map('trim', explode(',', env('WECHAT_OAUTH_SCOPES', 'snsapi_userinfo'))),
     'callback' => env('WECHAT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
 ],

@YiYang 谢谢提醒,我还没接触到支付,到时候我留意一下,如果还有不懂,再向你请教哈。

@安正超 恩恩,后来jelly帮我配置了,我对比了一下差异,应该是scope配置,还有回调页面的问题,回调页面应该写成Route:any路由里的url

@JellyBool 新建的项目,就在env和wechat.php配置了微信公众账号的一些参数,没有设置过snsapi_login。

WECHAT_APPID
WECHAT_SECRET
WECHAT_TOKEN
WECHAT_AES_KEY

WECHAT_OAUTH_SCOPES
WECHAT_OAUTH_CALLBACK

清除过缓存,代码是最新的,到服务器看没有出现代码不同步。

公众号是认证服务号,网页登陆配置的回调页面地址为:www.h-p-x.com。跟着教程,操作了好几遍了还是不行,Google了没找到成功的解决方案,有没有遇到同样问题的呢?

.env文件

WECHAT_OAUTH_SCOPES=snsapi_userinfo
WECHAT_OAUTH_CALLBACK=www.h-p-x.com

wechat.php配置文件

'wechat_oauth_scopes' => env('WECHAT_OAUTH_SCOPES','your-scopes'),
'wechat_oauth_callback' => env('WECHAT_OAUTH_CALLBACK','your-callback'),

route路由文件

Route::group(['middleware' => ['web', 'wechat.oauth']], function () {
    Route::get('/user', function () {
       $user = session('wechat.oauth_user'); // 拿到授权用户资料
       return view('user',compact('user'));
    });
});

wechat日记文件

[2016-04-19 22:54:30] easywechat.DEBUG: Current configuration: {"debug":true,"use_laravel_cache":true,"app_id":"wxa2a186a68def0e2c","secret":"5aae87659bae4d59f397b934eb607e0d","token":"wechat","aes_key":"Z1klgyrJGpxLfuc4PS2RR9E55p9kqJWMrYyGSFPY5FV","log":{"level":"debug","file":"/var/www/wechat_riguo/storage/logs/wechat.log"},"wecaht_oauth_scopes":"snsapi_userinfo","wechat_oauth_callback":"www.h-p-x.com"} []
[2016-04-19 22:54:30] easywechat.DEBUG: Request received: {"Method":"POST","URI":"/wechat?signature=8616325fed9505145212c6adb03cf6563f04f820&timestamp=1461077669&nonce=1084037041","Query":"nonce=1084037041&signature=8616325fed9505145212c6adb03cf6563f04f820&timestamp=1461077669","Protocal":"HTTP/1.0","Content":"<xml><ToUserName><![CDATA[gh_55bca6c8addb]]></ToUserName>\n<FromUserName><![CDATA[o7-jmwSIG1S37CM7v9JTQtUmKM1Y]]></FromUserName>\n<CreateTime>1461077669</CreateTime>\n<MsgType><![CDATA[event]]></MsgType>\n<Event><![CDATA[VIEW]]></Event>\n<EventKey><![CDATA[http://h-p-x.com/user]]></EventKey>\n<MenuId>403324681</MenuId>\n</xml>"} []
[2016-04-19 22:54:30] easywechat.DEBUG: Message detail: {"ToUserName":"gh_55bca6c8addb","FromUserName":"o7-jmwSIG1S37CM7v9JTQtUmKM1Y","CreateTime":"1461077669","MsgType":"event","Event":"VIEW","EventKey":"http://h-p-x.com/user","MenuId":"403324681"} []
[2016-04-19 22:54:30] easywechat.DEBUG: Server response created: {"response":"success"} []
[2016-04-19 22:54:30] easywechat.DEBUG: Current configuration: {"debug":true,"use_laravel_cache":true,"app_id":"wxa2a186a68def0e2c","secret":"5aae87659bae4d59f397b934eb607e0d","token":"wechat","aes_key":"Z1klgyrJGpxLfuc4PS2RR9E55p9kqJWMrYyGSFPY5FV","log":{"level":"debug","file":"/var/www/wechat_riguo/storage/logs/wechat.log"},"wecaht_oauth_scopes":"snsapi_userinfo","wechat_oauth_callback":"www.h-p-x.com"} []