push-huawei
Advanced tools
Comparing version 0.1.9 to 0.2.0
@@ -15,2 +15,3 @@ const axios = require('axios'); | ||
options.timeout = options.timeout || 300000; | ||
options.tokenCacheTime = options.tokenCacheTime || 3000000; | ||
@@ -136,3 +137,3 @@ if (!options.appId) throw new Error('Huawei AppId 不能为空'); | ||
async getToken() { | ||
if (cache.access_token && new Date().getTime() - cache.time < 3600000) { | ||
if (cache.access_token && new Date().getTime() - cache.time < this.options.tokenCacheTime) { | ||
return { access_token: cache.access_token } | ||
@@ -139,0 +140,0 @@ } |
{ | ||
"name": "push-huawei", | ||
"version": "0.1.9", | ||
"version": "0.2.0", | ||
"description": "push-huawei", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7930
144