Skip to content

Commit b9edb2d

Browse files
committed
Update documentation
1 parent 048f2e6 commit b9edb2d

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

lib/api_common.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ AccessToken.prototype.isValid = function () {
3232
* 1. 调用用户传入的获取token的异步方法,获得token之后使用
3333
* 2. 使用appid/appsecret获取token。并调用用户传入的保存token方法保存
3434
*
35+
* Tips:
36+
*
37+
* - 如果跨机器运行wechat模块,需要注意同步机器之间的系统时间。
38+
*
3539
* Examples:
3640
* ```
3741
* var API = require('wechat').API;

lib/oauth.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@ OAuth.prototype.getAuthorizeURL = function (redirect, state, scope) {
107107
* Result:
108108
* ```
109109
* {
110-
* "access_token": "ACCESS_TOKEN",
111-
* "expires_in": 7200,
112-
* "refresh_token": "REFRESH_TOKEN",
113-
* "openid": "OPENID",
114-
* "scope": "SCOPE"
110+
* data: {
111+
* "access_token": "ACCESS_TOKEN",
112+
* "expires_in": 7200,
113+
* "refresh_token": "REFRESH_TOKEN",
114+
* "openid": "OPENID",
115+
* "scope": "SCOPE"
116+
* }
115117
* }
116118
* ```
117119
* @param {String} code 授权获取到的code
@@ -146,11 +148,13 @@ OAuth.prototype.getAccessToken = function (code, callback) {
146148
* Result:
147149
* ```
148150
* {
149-
* "access_token": "ACCESS_TOKEN",
150-
* "expires_in": 7200,
151-
* "refresh_token": "REFRESH_TOKEN",
152-
* "openid": "OPENID",
153-
* "scope": "SCOPE"
151+
* data: {
152+
* "access_token": "ACCESS_TOKEN",
153+
* "expires_in": 7200,
154+
* "refresh_token": "REFRESH_TOKEN",
155+
* "openid": "OPENID",
156+
* "scope": "SCOPE"
157+
* }
154158
* }
155159
* ```
156160
* @param {Function} callback 回调函数

0 commit comments

Comments
 (0)