abler-api 0.1.71 → 0.1.72

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.
Files changed (2) hide show
  1. package/dist/cjs/pp-util.js +11 -11
  2. package/package.json +1 -1
@@ -33,7 +33,7 @@ const {
33
33
  netUtil: netUtil$1
34
34
  } = require$$4__default["default"];
35
35
  const fs$1 = require$$5__default["default"];
36
- let conf$3, appSetting$1, err$2, dbSql;
36
+ let conf$3, appSetting, err$2, dbSql;
37
37
  const pnToken = "access_token",
38
38
  hnToken = pnToken,
39
39
  pnApiKey = "apiKey",
@@ -58,13 +58,13 @@ class apiUtil$2 {
58
58
 
59
59
  static config(appConfig, appErrCfg, appDbSql) {
60
60
  conf$3 = appConfig;
61
- appSetting$1 = conf$3?.appSetting;
61
+ appSetting = conf$3?.appSetting;
62
62
  err$2 = appErrCfg;
63
63
  dbSql = appDbSql;
64
64
  ppUtil$4.config(appConfig, appErrCfg);
65
65
  kvStorage$1.config(appConfig, appErrCfg);
66
- apiUtil$2.debugFlag = appSetting$1?.debugFlag || apiUtil$2.debugFlag;
67
- apiUtil$2.testFlag = appSetting$1?.testFlag || apiUtil$2.testFlag; // apiUtil.apiCallRecSaver = apiCallRecSaver;
66
+ apiUtil$2.debugFlag = appSetting?.debugFlag || apiUtil$2.debugFlag;
67
+ apiUtil$2.testFlag = appSetting?.testFlag || apiUtil$2.testFlag; // apiUtil.apiCallRecSaver = apiCallRecSaver;
68
68
  } //#region ===== 需要应用系统重写的方法
69
69
 
70
70
  /**
@@ -611,7 +611,7 @@ class apiUtil$2 {
611
611
 
612
612
 
613
613
  static tokenExpireTime(req) {
614
- return apiUtil$2.isDebugMode(req) ? 30 * 24 * 60 * 60 : apiUtil$2.isTestMode(req) ? 4 * 60 * 60 : appSetting$1.tokenExpireTime;
614
+ return apiUtil$2.isDebugMode(req) ? 30 * 24 * 60 * 60 : apiUtil$2.isTestMode(req) ? 4 * 60 * 60 : appSetting.tokenExpireTime;
615
615
  }
616
616
  /**
617
617
  * 获取用户令牌保存键
@@ -1109,8 +1109,8 @@ class apiUtil$2 {
1109
1109
  static getEnvHosts(params) {
1110
1110
  configNeeded();
1111
1111
  return {
1112
- hosts: appSetting$1.serverHosts || ["localhost"],
1113
- port: appSetting$1.listenPort || +params.port || 8443
1112
+ hosts: appSetting.serverHosts || ["localhost"],
1113
+ port: appSetting.listenPort || +params.port || 8443
1114
1114
  };
1115
1115
  }
1116
1116
  /**
@@ -1574,7 +1574,7 @@ function configNeeded() {
1574
1574
  if (!conf$3 || !err$2) {
1575
1575
  ppUtil$4.configNeeded();
1576
1576
  conf$3 = ppUtil$4.appConfig;
1577
- appSetting$1 = conf$3.appSetting;
1577
+ appSetting = conf$3.appSetting;
1578
1578
  err$2 = ppUtil$4.appErrCfg;
1579
1579
  }
1580
1580
  }
@@ -1874,7 +1874,7 @@ class commonMessenger$2 {
1874
1874
  return conf$1.myMsgAddr;
1875
1875
  }
1876
1876
 
1877
- static setMessageHandle(messageHandle) {
1877
+ static setMessageHandle(messageHandle, msgChannel) {
1878
1878
  if (commonMessenger$2.redisMessenger) {
1879
1879
  return commonMessenger$2.redisMessenger.setMessageHandle(messageHandle, msgChannel);
1880
1880
  }
@@ -1886,7 +1886,7 @@ class commonMessenger$2 {
1886
1886
  return commonMessenger$2;
1887
1887
  }
1888
1888
 
1889
- static async publishMessage(message) {
1889
+ static async publishMessage(message, msgChannel) {
1890
1890
  if (commonMessenger$2.redisMessenger) {
1891
1891
  return commonMessenger$2.redisMessenger.publish(message, msgChannel);
1892
1892
  } else {
@@ -1923,7 +1923,7 @@ class commonMessenger$2 {
1923
1923
 
1924
1924
  async function forwardMessage(message) {
1925
1925
  let reqOptions = {
1926
- url: `https://${message.destAddr}:${appSetting.listenPort}/api/message`,
1926
+ url: `https://${message.destAddr}:${conf$1.appSetting.listenPort}/api/message`,
1927
1927
  method: "POST",
1928
1928
  data: message
1929
1929
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abler-api",
3
- "version": "0.1.71",
3
+ "version": "0.1.72",
4
4
  "description": "API服务相关工具",
5
5
  "main": "./dist/cjs/pp-util.js",
6
6
  "-module": "./dist/es/pp-util.js",