push-huawei
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -30,3 +30,19 @@ const axios = require('axios'); | ||
async push(data) { | ||
const { access_token } = await this.getToken(); | ||
const { access_token } = await this.getToken().catch((err) => { | ||
data.fail(err); | ||
return { | ||
access_token: null | ||
} | ||
}); | ||
if(!access_token) { | ||
data.finish({ | ||
status: 'success', | ||
maxLength: this.options.maxLength, | ||
group: 0, | ||
success_total: 0, | ||
fail_total: data.list.length | ||
}); | ||
return; | ||
} | ||
const customize = []; | ||
@@ -122,2 +138,3 @@ let n = 0; | ||
method: 'POST', | ||
timeout: this.options.timeout, | ||
data: querystring.stringify({ | ||
@@ -124,0 +141,0 @@ grant_type: this.options.grant_type, |
{ | ||
"name": "push-huawei", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "push-huawei", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7587
135
1