abler-api 0.1.62 → 0.1.64

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.
@@ -57,10 +57,12 @@ class apiUtil$2 {
57
57
  }; // static apiCallRecSaver;
58
58
 
59
59
  static config(appConfig, appErrCfg, appDbSql) {
60
- ppUtil$4.config(appConfig, appErrCfg);
61
60
  conf$3 = appConfig;
62
61
  appSetting$1 = conf$3?.appSetting;
63
- err$2 = appErrCfg, dbSql = appDbSql;
62
+ err$2 = appErrCfg;
63
+ dbSql = appDbSql;
64
+ ppUtil$4.config(appConfig, appErrCfg);
65
+ kvStorage$1.config(appConfig, appErrCfg);
64
66
  apiUtil$2.debugFlag = appSetting$1?.debugFlag || apiUtil$2.debugFlag;
65
67
  apiUtil$2.testFlag = appSetting$1?.testFlag || apiUtil$2.testFlag; // apiUtil.apiCallRecSaver = apiCallRecSaver;
66
68
  } //#region ===== 需要应用系统重写的方法
@@ -465,8 +467,14 @@ class apiUtil$2 {
465
467
  configNeeded();
466
468
 
467
469
  if (!req.accessToken) {
468
- //检查post的信息或者url查询参数或者头信息
469
- let token = req.headers[hnToken] || req.headers['x-access-token']; //向后兼容
470
+ let token = req.header('Authorization');
471
+
472
+ if (token && token.startsWith('Bearer ')) {
473
+ token = token.substring(7);
474
+ } else {
475
+ //检查post的信息或者url查询参数或者头信息
476
+ token = req.headers[hnToken] || req.headers['x-access-token']; //向后兼容
477
+ }
470
478
 
471
479
  if (!token) {
472
480
  let params = apiUtil$2.extractParams(req);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "0.1.62",
3
+ "version": "0.1.64",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",