1.0.2 • Published 6 years ago
iseber-wx v1.0.2
iseberWx 是广州石贝网络的公众号开发的微信方法集合.
Decoding
npm install
var iseberWx = require('iseber-wx');
/***
params: appid:微信公众号AppID,
secret:微信公众号secret,
cacheIp:memcached的主机Ip,
cachePort:memcached的使用端口号
***/
var wx = new iseberWx(appid,secret,cacheIp,cachePort);
/***
params:
ASSII排列
***/
wx.raw();
/***
params:
获取网页权限
***/
wx.getAccessToken().done(function(result){
console.log(result);
});
/***
params: code // 微信网页授权的返回code值
获取授权用户的openid
***/
wx.getWeixinOpenId(code).done(function(result){
console.log(result);
});
/***
params: code // wx.getWeixinOpenId得到的用户的openid
获取授权用户的个人信息openid
***/
wx.getWeixinUserInfo(openid).done(function(result){
console.log(result);
});
/***
params: param // param={
"openid":openid,// 被推送人的openid
"template_id":template_id,// 推送的消息的模版ID
"url":url, // 点击推送消息要跳转的连接
"data":data // 推送消息的详细数据
}
向关注公众号指定用户推送消息
***/
wx.pushModelMsg(param).done(function(result){
console.log(result);
});
Encoding
更多npm包 关注angaoju