abler-api 0.1.40 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/pp-util.js +5 -5
- package/package.json +1 -1
- package/dist/es/pp-util.js +0 -2017
package/dist/cjs/pp-util.js
CHANGED
|
@@ -936,7 +936,7 @@ class apiUtil$2 {
|
|
|
936
936
|
let token = apiUtil$2.extractToken(req);
|
|
937
937
|
|
|
938
938
|
if (token) {
|
|
939
|
-
apiUtil$2.storeToken(apiTokenStoreKey(token), tokenData, tokenData.apiKey, req);
|
|
939
|
+
apiUtil$2.storeToken(apiUtil$2.apiTokenStoreKey(token), tokenData, tokenData.apiKey, req);
|
|
940
940
|
}
|
|
941
941
|
|
|
942
942
|
console.log(`公司(${tokenData.apiKey})备用证书成功转换为正式证书`);
|
|
@@ -1313,7 +1313,7 @@ class apiUtil$2 {
|
|
|
1313
1313
|
if (errResponse != null) {
|
|
1314
1314
|
apiUtil$2._saveApiCallRec(req.apiCallRec, errResponse);
|
|
1315
1315
|
|
|
1316
|
-
apiUtil$2.sendOrRedirect(
|
|
1316
|
+
apiUtil$2.sendOrRedirect(res, params.redirectUrl || params.callbackUrl, errResponse);
|
|
1317
1317
|
} else {
|
|
1318
1318
|
apiUtil$2.checkApiCallValid(tokenData, req).then(companyInfo => {
|
|
1319
1319
|
params.companyId = params.companyId || companyInfo.companyId;
|
|
@@ -1321,11 +1321,11 @@ class apiUtil$2 {
|
|
|
1321
1321
|
next();
|
|
1322
1322
|
}, e => {
|
|
1323
1323
|
console.log('apiCallInvalid:', e);
|
|
1324
|
-
let errResponse = spoApiFail(e, req);
|
|
1324
|
+
let errResponse = apiUtil$2.spoApiFail(e, req);
|
|
1325
1325
|
|
|
1326
1326
|
apiUtil$2._saveApiCallRec(req.apiCallRec, errResponse);
|
|
1327
1327
|
|
|
1328
|
-
apiUtil$2.sendOrRedirect(
|
|
1328
|
+
apiUtil$2.sendOrRedirect(res, params.redirectUrl || params.callbackUrl, errResponse);
|
|
1329
1329
|
});
|
|
1330
1330
|
}
|
|
1331
1331
|
}
|
|
@@ -1365,7 +1365,7 @@ class apiUtil$2 {
|
|
|
1365
1365
|
return apiUtil$2.$checkApiKeyOld(req, res, next);
|
|
1366
1366
|
}).catch(e => {
|
|
1367
1367
|
const params = apiUtil$2.extractParams(req);
|
|
1368
|
-
apiUtil$2.sendOrRedirect(
|
|
1368
|
+
apiUtil$2.sendOrRedirect(res, params.redirectUrl || params.callbackUrl, apiUtil$2.spoApiFail(err$2.TOKEN_INVALID, req));
|
|
1369
1369
|
});
|
|
1370
1370
|
}
|
|
1371
1371
|
/**
|