abler-api 0.1.49 → 0.1.50

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.
@@ -1426,7 +1426,8 @@ class apiUtil$2 {
1426
1426
  throw {
1427
1427
  status: 401,
1428
1428
  error: {
1429
- code: 40101,
1429
+ success: false,
1430
+ stateCode: 40101,
1430
1431
  message: 'need username and password'
1431
1432
  }
1432
1433
  };
@@ -1436,7 +1437,8 @@ class apiUtil$2 {
1436
1437
  throw {
1437
1438
  status: 401,
1438
1439
  error: {
1439
- code: 40102,
1440
+ success: false,
1441
+ stateCode: 40102,
1440
1442
  message: 'invalid username or password'
1441
1443
  }
1442
1444
  };
@@ -1450,7 +1452,7 @@ class apiUtil$2 {
1450
1452
  res.set('WWW-Authenticate', `Basic realm=validate fail`);
1451
1453
  }
1452
1454
 
1453
- return res.status(e.status || 500).send(e);
1455
+ return res.status(e.status || 500).send(e.error || e);
1454
1456
  }
1455
1457
 
1456
1458
  return next();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",