Skip to content

Commit 34504f7

Browse files
committed
deprecate wechat.API
1 parent 5a1793e commit 34504f7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ wechat.List = require('./lib/list');
44
// 事件
55
wechat.Event = require('./lib/events');
66

7-
wechat.API = require('wechat-api');
7+
Object.defineProperty(wechat, "API", {
8+
get: function () {
9+
console.log('The API property deprecated, Use require("wechat-api") instead');
10+
return require('wechat-api');
11+
}
12+
});
13+
814
wechat.OAuth = require('./lib/oauth');
915
wechat.util = require('./lib/util');
1016
module.exports = wechat;

0 commit comments

Comments
 (0)