abler-api 0.1.19 → 0.1.22

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.
@@ -1055,14 +1055,9 @@ class apiUtil$1 {
1055
1055
 
1056
1056
  static getEnvHosts(params) {
1057
1057
  configNeeded();
1058
- let envType = ppUtil$2.getEnvType();
1059
- let x = conf$1.envHosts[envType] || {
1060
- hosts: ["localhost"]
1061
- };
1062
- let port = +params.port || 8443;
1063
1058
  return {
1064
- hosts: x.hosts,
1065
- port: x.port || port
1059
+ hosts: appSetting.serverHosts || ["localhost"],
1060
+ port: appSetting.listenPort || +params.port || 8443
1066
1061
  };
1067
1062
  }
1068
1063
  /**
@@ -1075,7 +1070,7 @@ class apiUtil$1 {
1075
1070
 
1076
1071
  static async hostIsMySelf(host, req) {
1077
1072
  let clientIp = apiUtil$1.getClientIp(req);
1078
- return getMyIp({
1073
+ return ppUtil$2.getMyIp({
1079
1074
  hosts: [host, clientIp]
1080
1075
  });
1081
1076
  }
@@ -1438,10 +1433,6 @@ function configNeeded() {
1438
1433
 
1439
1434
  var ppUtilApi = apiUtil$1;
1440
1435
 
1441
- function commonjsRequire(path) {
1442
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
1443
- }
1444
-
1445
1436
  const fs = require$$0__default$1["default"];
1446
1437
  const path = require$$1__default$1["default"];
1447
1438
  const ppUtil$1 = require$$1__default["default"].ppUtil;
@@ -1525,8 +1516,8 @@ class preconditions$1 {
1525
1516
  */
1526
1517
 
1527
1518
 
1528
- static async checkExEnvSetting() {
1529
- return await checkExEnvSetting();
1519
+ static async checkExEnvSetting(loadjs) {
1520
+ return await checkExEnvSetting(loadjs);
1530
1521
  }
1531
1522
  /**
1532
1523
  * redis 可用性检查
@@ -1560,7 +1551,7 @@ async function createEnvSettingFile(fileName) {
1560
1551
  }
1561
1552
  }
1562
1553
 
1563
- async function checkExEnvSetting() {
1554
+ async function checkExEnvSetting(loadjs) {
1564
1555
  if (!conf._envSetting.localSettingImported) {
1565
1556
  let fileName = conf.getEnvSettingFileName();
1566
1557
 
@@ -1568,7 +1559,7 @@ async function checkExEnvSetting() {
1568
1559
  return await createEnvSettingFile(fileName);
1569
1560
  }
1570
1561
 
1571
- let envSettingEx = commonjsRequire(fileName);
1562
+ let envSettingEx = loadjs(fileName);
1572
1563
 
1573
1564
  if (envSettingEx.cfgVersion !== conf._envSettings.default.cfgVersion) {
1574
1565
  if (envSettingEx.cfgVersion !== "0.0") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "0.1.19",
3
+ "version": "0.1.22",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",