netputer / wechat-php-sdk

微信公众平台 PHP SDK
MIT License
678 stars 350 forks source link

关于验证 #31

Open JimChenWYU opened 9 years ago

JimChenWYU commented 9 years ago

wechat类内构造函数你以1个数组为参数,然而你实例化时是却以4个参数传输,所以验证时一直不行,改了就好。

qiangqiangsir commented 6 years ago

你好,我是初学者,我的URL填写为“http://4.17896013057.applinzi.com/example/server.php”,token 改为了“weixin”,实例化时也修改了相应内容
$wechat = new MyWechat(array( 'weixin' => $token, 'VAv5kjJk7GDTMWf0qlzRuTvbU75LJAjF5GYFCA448ET' => $encodingAesKey, 'wx9797764f924e0423' => $appId, 'debug' => $debugMode )); 我甚至在构造函数里也修改了默认值,可还是提示验证失败,请问是什么原因呢?

JimChenWYU commented 6 years ago

@qiangqiangsir lol... 3年了,我忘了,作者也没有持续维护这个库,推荐你用easywechat,使用前通读一下微信开放平台的文档,配合着看一下官方的SDK(虽然官方SDK写得很烂...),之后再使用easywechat,不然你会用得很痛苦

geekdadley commented 6 years ago

$wechat = new MyWechat(array( 'weixin' => $token, 'VAv5kjJk7GDTMWf0qlzRuTvbU75LJAjF5GYFCA448ET' => $encodingAesKey, 'wx9797764f924e0423' => $appId, 'debug' => $debugMode ));

这个有问题吧,为什么会有 'wx9797764f924e0423' , 'VAv5kjJk7GDTMWf0qlzRuTvbU75LJA jF5GYFCA448ET' 这么奇怪的字段名? 你是不是key value写反了

On Tue, Jul 10, 2018 at 4:24 PM qiangqiangsir notifications@github.com wrote:

你好,我是初学者,我的URL填写为“ http://4.17896013057.applinzi.com/example/server.php”,token 改为了“weixin”,实例化时也修改了相应内容 $wechat = new MyWechat(array( 'weixin' => $token, 'VAv5kjJk7GDTMWf0qlzRuTvbU75LJAjF5GYFCA448ET' => $encodingAesKey, 'wx9797764f924e0423' => $appId, 'debug' => $debugMode )); 我甚至在构造函数里也修改了默认值,可还是提示验证失败,请问是什么原因呢?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/netputer/wechat-php-sdk/issues/31#issuecomment-403741423, or mute the thread https://github.com/notifications/unsubscribe-auth/AA-p7x_YC84oL3nIeVTvgN4tdKobVE3uks5uFGShgaJpZM4F8Quj .

qiangqiangsir commented 6 years ago

这是微信自动生成的appID和 随机EncodingAESKey @duduzhu

JimChenWYU commented 6 years ago

@qiangqiangsir https://github.com/netputer/wechat-php-sdk/commit/03e5842c05ace86d12e6241621e670510d75979d

qiangqiangsir commented 6 years ago

我看到这个了,也已经修改为自己的token 和 appId了 @JimChenWYU ,原作者的代码也已经把这个bug改过来了;问个简单的问题哈,如何调试这个代码呢?我自己去查找问题; 我在网扒拉好几天了 ,微信web调试工具也下载了,但是没有具体的使用指导 @duduzhu @JimChenWYU

geekdadley commented 6 years ago

@qiangqiangsir 你修改的不对。我已经说过了,没有那么奇怪的key,你填在key的位置的东西,其实应该填在value上。

geekdadley commented 6 years ago
$wechat = new MyWechat(array(
'weixin' => $token,
'aeskey'=>'VAv5kjJk7GDTMWf0qlzRuTvbU75LJAjF5GYFCA448ET',
'appid'=>'wx9797764f924e0423' ,
'debug' => $debugMode
));