Wechat.prototype.updateAccessToken = function () {
var appID = this.appID
var appSecret = this.appSecret
var url = api.accessToken + '&appid=' + appID + '&secret=' + appSecret
return new Promise(function (resolve,reject) {
request({url:url,json:true}).then(function (response) {
var data = response
var now = (new Date().getTime())
var expires_in = now + (data.expires_in - 20) * 1000
data.expires_in = expires_in
resolve(data)
})
})
}