abler-api 0.1.62 → 0.1.63

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.
@@ -465,8 +465,14 @@ class apiUtil$2 {
465
465
  configNeeded();
466
466
 
467
467
  if (!req.accessToken) {
468
- //检查post的信息或者url查询参数或者头信息
469
- let token = req.headers[hnToken] || req.headers['x-access-token']; //向后兼容
468
+ let token = req.header('Authorization');
469
+
470
+ if (token && token.startsWith('Bearer ')) {
471
+ token = token.substring(7);
472
+ } else {
473
+ //检查post的信息或者url查询参数或者头信息
474
+ token = req.headers[hnToken] || req.headers['x-access-token']; //向后兼容
475
+ }
470
476
 
471
477
  if (!token) {
472
478
  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.63",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",