关于微信公众账号接入验证问题,官方只有php验证,有js验证码?求大神写个!
网上有好多 function(signature, timestamp, nonce, echostr){ var oriArray = new Array(); oriArray[0] = nonce; oriArray[1] = timestamp; oriArray[2] = token; oriArray.sort(); var original = oriArray[0]+oriArray[1]+oriArray[2]; console.log(“Original Str:”+original); console.log(“signature:”+signature); var scyptoString = sha1(original); if (signature == scyptoString) { return true; } else { return false; } } function sha1(str) { var crypto = require(‘crypto’); var md5sum = crypto.createHash(‘sha1’); md5sum.update(str); str = md5sum.digest(‘hex’); return str; }
完整版 sdk 都有了…