getweixincode :https://github.com/hadb/zjdxbc/peasywechat :3359 www.easywechat.com/docs/3.x/zh-cn/on
1:easywecaht软件包的
over true/socialite/src/providers/abstract provider.PHP文件中的redirect方法如下:
publicfunctionredirect ($ redirecturl=null,$address=null ) { $state=null; if (! is_null($redirecturl ) { $ this-redirecturl=$ redirecturl; }if($this-usesstate () ) { $state=$this-makeState ); } returnnewredirectresponse ($ this-getauthurl ) $state,$address ); (2) easywecaht软件包的
over true/socialite/src/providers/wechat provider.PHP文件中的getAuthUrl方法
如下所示。
protectedfunctiongetauthurl ($ state,$address=' ) { $path='oauth2/authorize '; if(in_arrayssdhmlogin (,$this-scopes ) ) { $path='qrconnect ); } $ URL=' https://open.weixin.QQ.com/connect/'; if($address ) { $url=$address; }else{ $url .=$path; } return $ this-buildauthurlfrombase ($ URL,$state ); } 3:现在修改完毕,调用如下。
publicfunctionoauth (($ app=new application ) wxconfig3360:get ) ); $oauth=$app-oauth; $ result=$ oauth-redirect (' http://ly.fet6. cn/index/wx/callback ',' http://shop.fet6. cn/we chat _ au auth.he larvel :返回$ result; $result-send (; }