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.
- package/dist/cjs/pp-util.js +8 -2
- package/package.json +1 -1
package/dist/cjs/pp-util.js
CHANGED
|
@@ -465,8 +465,14 @@ class apiUtil$2 {
|
|
|
465
465
|
configNeeded();
|
|
466
466
|
|
|
467
467
|
if (!req.accessToken) {
|
|
468
|
-
|
|
469
|
-
|
|
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);
|