Skip to content

Commit 12c2d19

Browse files
committed
移除getQRCode接口,补充单元测试
1 parent 4da1cb5 commit 12c2d19

File tree

5 files changed

+183
-161
lines changed

5 files changed

+183
-161
lines changed

lib/common.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -256,23 +256,6 @@ API.prototype._removeMenu = function (callback) {
256256
urllib.request(url, {dataType: 'json'}, wrapper(callback));
257257
};
258258

259-
/**
260-
* 获取二维码
261-
* @param {Object} data 二维码数据
262-
* @param {Function} callback 回调函数
263-
*/
264-
API.prototype.getQRCode = function (data, callback) {
265-
this.preRequest(this._getQRCode, arguments);
266-
};
267-
268-
/*!
269-
* 获取二维码的未封装版本
270-
*/
271-
API.prototype._getQRCode = function (data, callback) {
272-
var url = this.prefix + 'qrcode/get?access_token=' + this.token.accessToken;
273-
urllib.request(url, postJSON(data), wrapper(callback));
274-
};
275-
276259
/**
277260
* 创建临时二维码
278261
* 详细请看:<http://mp.weixin.qq.com/wiki/index.php?title=生成带参数的二维码>
@@ -508,7 +491,7 @@ API.prototype._moveUserToGroup = function (openid, groupId, callback) {
508491
// https://api.weixin.qq.com/cgi-bin/groups/members/update?access_token=ACCESS_TOKEN
509492
// POST数据格式:json
510493
// POST数据例子:{"openid":"oDF3iYx0ro3_7jD4HFRDfrjdCM58","to_groupid":108}
511-
var url = this.prefix + 'groups/update?access_token=' + this.token.accessToken;
494+
var url = this.prefix + 'groups/members/update?access_token=' + this.token.accessToken;
512495
var data = {
513496
"openid": openid,
514497
"to_groupid": groupId
@@ -714,8 +697,8 @@ API.prototype.sendVoice = function (openid, mediaId, callback) {
714697
API.prototype._sendVoice = function (openid, mediaId, callback) {
715698
// {
716699
// "touser":"OPENID",
717-
// "msgtype":"image",
718-
// "image": {
700+
// "msgtype":"voice",
701+
// "voice": {
719702
// "media_id":"MEDIA_ID"
720703
// }
721704
// }

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"supertest": "*",
3535
"mocha": "*",
3636
"should": "*",
37+
"expect.js": "*",
3738
"connect": "*",
3839
"blanket": "*",
3940
"travis-cov": "*",

0 commit comments

Comments
 (0)