abler-api 0.1.41 → 0.1.43

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.
@@ -653,17 +653,17 @@ class apiUtil$2 {
653
653
  tokenData.certPublicKey = req.certPublicKey;
654
654
  }
655
655
 
656
- kvStorage.storeObj(token, tokenData, timeout);
656
+ await kvStorage.storeObj(token, tokenData, timeout);
657
657
 
658
658
  if (dataId) {
659
- kvStorage.restoreValue("token_" + dataId).then(function (oldToken) {
659
+ await kvStorage.restoreValue("token_" + dataId).then(async oldToken => {
660
660
  if (oldToken !== token) {
661
- kvStorage.unstoreValue(oldToken);
661
+ await kvStorage.unstoreValue(oldToken);
662
662
  } else {
663
663
  dataId = "";
664
664
  }
665
- }, function (e) {}).then(() => {
666
- if (dataId !== "") kvStorage.storeValue("token_" + dataId, token, timeout);
665
+ }, function (e) {}).then(async () => {
666
+ if (dataId !== "") await kvStorage.storeValue("token_" + dataId, token, timeout);
667
667
  });
668
668
  }
669
669
  }
@@ -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})备用证书成功转换为正式证书`);
@@ -1321,7 +1321,7 @@ 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",