abler-api 0.1.37 → 0.1.39

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.
@@ -84,7 +84,7 @@ class apiUtil$2 {
84
84
 
85
85
 
86
86
  static signatureVerified(req) {
87
- return req.signatureVerified;
87
+ return req?.signatureVerified;
88
88
  } //#endregion
89
89
  //#region ===== API服务相关工具
90
90
 
@@ -698,7 +698,7 @@ class apiUtil$2 {
698
698
  return req.apiCallRec;
699
699
  });
700
700
  } else {
701
- let params = this.extractParams(req); // let contentLength = parseInt(req.headers["content-length"]) || 0;
701
+ let params = apiUtil$2.extractParams(req); // let contentLength = parseInt(req.headers["content-length"]) || 0;
702
702
 
703
703
  let rec = {
704
704
  id: ppUtil$4.newGuid(),
@@ -987,7 +987,7 @@ class apiUtil$2 {
987
987
  // // 没有设置ip白名单的就不检查了
988
988
  // if (whiteList == "" || ipMatched(tokenData.clientIp, whiteList + ",127.0.0.1,1"))
989
989
 
990
- if (apiUtil$2.signatureVerified()) return companyInfo;
990
+ if (apiUtil$2.signatureVerified(req)) return companyInfo;
991
991
  return apiUtil$2.verifyApiSignature(tokenData, req).then(x => {
992
992
  return companyInfo;
993
993
  }, e => {
@@ -1275,7 +1275,7 @@ class apiUtil$2 {
1275
1275
  static $isMobile(req, res, next) {
1276
1276
  req.isMobile = true;
1277
1277
 
1278
- if (!req.signatureVerified) {
1278
+ if (!apiUtil$2.signatureVerified(req)) {
1279
1279
  let params = apiUtil$2.extractParams(req);
1280
1280
  moveProperty(params, req.headers, "access_token");
1281
1281
  moveProperty(params, req.headers, "timestamp");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",