Skip to content

Commit 41c8439

Browse files
committed
fix undefined variable
1 parent 7b98655 commit 41c8439

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

lib/api_message.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ exports._sendTextFromCs = function (openid, cs_account, text, callback) {
5656
'content': text
5757
},
5858
'customservice':{
59-
"kf_account": cs_account
59+
'kf_account': cs_account
6060
}
6161
};
6262
this.request(url, postJSON(data), wrapper(callback));
@@ -166,7 +166,7 @@ exports._sendImageFromCs = function (openid,cs_account, mediaId, callback) {
166166
'media_id': mediaId
167167
},
168168
'customservice':{
169-
"kf_account": cs_account
169+
'kf_account': cs_account
170170
}
171171
};
172172
this.request(url, postJSON(data), wrapper(callback));
@@ -255,7 +255,7 @@ exports._sendVoiceFromCs = function (openid,cs_account, mediaId, callback) {
255255
'media_id': mediaId
256256
},
257257
'customservice':{
258-
"kf_account": cs_account
258+
'kf_account': cs_account
259259
}
260260
};
261261
this.request(url, postJSON(data), wrapper(callback));
@@ -350,7 +350,7 @@ exports._sendVideoFromCs = function (openid,cs_account, mediaId, thumbMediaId, c
350350
'thumb_media_id': thumbMediaId
351351
},
352352
'customservice':{
353-
"kf_account": cs_account
353+
'kf_account': cs_account
354354
}
355355
};
356356
this.request(url, postJSON(data), wrapper(callback));
@@ -457,7 +457,7 @@ exports._sendMusicFromCs = function (openid,cs_account, music, callback) {
457457
'msgtype':'music',
458458
'music': music,
459459
'customservice':{
460-
"kf_account": cs_account
460+
'kf_account': cs_account
461461
}
462462
};
463463
this.request(url, postJSON(data), wrapper(callback));
@@ -596,7 +596,7 @@ exports._sendNewsFromCs = function (openid,cs_account, articles, callback) {
596596
'articles': articles
597597
},
598598
'customservice':{
599-
"kf_account": cs_account
599+
'kf_account': cs_account
600600
}
601601
};
602602
this.request(url, postJSON(data), wrapper(callback));
@@ -688,7 +688,7 @@ exports._sendMpNewsFromCs = function (openid,cs_account, mediaId, callback) {
688688
'media_id': mediaId
689689
},
690690
'customservice':{
691-
"kf_account": cs_account
691+
'kf_account': cs_account
692692
}
693693
};
694694
this.request(url, postJSON(data), wrapper(callback));
@@ -771,7 +771,7 @@ exports._sendCardFromCs = function (openid,cs_account, card, callback) {
771771
'card_ext': result
772772
},
773773
'customservice':{
774-
"kf_account": cs_account
774+
'kf_account': cs_account
775775
}
776776
};
777777
that.request(url, postJSON(data), wrapper(callback));

lib/api_template.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ exports.sendTemplate = function (openid, templateId, dest, data, callback, callb
197197

198198
exports._sendTemplate = function (openid, templateId, dest, data, callback, callback2) {
199199
/*
200-
duplicated interface `function (openid, templateId, url, topColor, data, callback)`
200+
* duplicated interface `function (openid, templateId, url, topColor, data, callback)`
201201
*/
202202
var apiUrl = this.endpoint + '/cgi-bin/message/template/send?access_token=' + this.token.accessToken;
203203

@@ -206,6 +206,7 @@ exports._sendTemplate = function (openid, templateId, dest, data, callback, call
206206
callback = callback2;
207207
}
208208

209+
var url, miniprogram;
209210
if (typeof dest === 'string') {
210211
url = dest;
211212
} else {

lib/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports.wrapper = function (callback) {
1818
return callback(err, data, res);
1919
}
2020
if (data == null) {
21-
err = new Error("No data received.");
21+
err = new Error('No data received.');
2222
err.name = 'WeChatAPIError';
2323
err.code = -1;
2424
return callback(err, data, res);

test/api_template.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ describe('api_template', function () {
3636
var dest = {
3737
url: 'http://weixin.qq.com/download',
3838
miniprogram:{
39-
appid: "xiaochengxuappid12345",
40-
pagepath: "index?foo=bar"
39+
appid: 'xiaochengxuappid12345',
40+
pagepath: 'index?foo=bar'
4141
}
4242
};
4343
var data = {
@@ -69,8 +69,8 @@ describe('api_template', function () {
6969
var dest = {
7070
url: 'http://weixin.qq.com/download',
7171
miniprogram:{
72-
appid: "xiaochengxuappid12345",
73-
pagepath: "index?foo=bar"
72+
appid: 'xiaochengxuappid12345',
73+
pagepath: 'index?foo=bar'
7474
}
7575
};
7676
var data = {

0 commit comments

Comments
 (0)