Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Jul 28, 2014
1 parent 048f2e6 commit b9edb2d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
4 changes: 4 additions & 0 deletions lib/api_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ AccessToken.prototype.isValid = function () {
* 1. 调用用户传入的获取token的异步方法,获得token之后使用
* 2. 使用appid/appsecret获取token。并调用用户传入的保存token方法保存
*
* Tips:
*
* - 如果跨机器运行wechat模块,需要注意同步机器之间的系统时间。
*
* Examples:
* ```
* var API = require('wechat').API;
Expand Down
24 changes: 14 additions & 10 deletions lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ OAuth.prototype.getAuthorizeURL = function (redirect, state, scope) {
* Result:
* ```
* {
* "access_token": "ACCESS_TOKEN",
* "expires_in": 7200,
* "refresh_token": "REFRESH_TOKEN",
* "openid": "OPENID",
* "scope": "SCOPE"
* data: {
* "access_token": "ACCESS_TOKEN",
* "expires_in": 7200,
* "refresh_token": "REFRESH_TOKEN",
* "openid": "OPENID",
* "scope": "SCOPE"
* }
* }
* ```
* @param {String} code 授权获取到的code
Expand Down Expand Up @@ -146,11 +148,13 @@ OAuth.prototype.getAccessToken = function (code, callback) {
* Result:
* ```
* {
* "access_token": "ACCESS_TOKEN",
* "expires_in": 7200,
* "refresh_token": "REFRESH_TOKEN",
* "openid": "OPENID",
* "scope": "SCOPE"
* data: {
* "access_token": "ACCESS_TOKEN",
* "expires_in": 7200,
* "refresh_token": "REFRESH_TOKEN",
* "openid": "OPENID",
* "scope": "SCOPE"
* }
* }
* ```
* @param {Function} callback 回调函数
Expand Down

0 comments on commit b9edb2d

Please sign in to comment.