crabatool 1.0.437 → 1.0.440

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/lib/server.js CHANGED
@@ -83,7 +83,7 @@ function createServer(app, options) {
83
83
  utils.log('已开启自动刷新');
84
84
 
85
85
  if (!config.socketPort) {
86
- config.socketPort = config.port + 6000;
86
+ config.socketPort = Number(config.port) + 6000; //最大65536
87
87
  }
88
88
 
89
89
  require('../tool/sockettool.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.437",
3
+ "version": "1.0.440",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "bin": {
package/tool/checkgspx.js CHANGED
@@ -143,15 +143,24 @@ function readGspxToJSON(fileName, data) {
143
143
  return rootNode;
144
144
  }
145
145
 
146
- function addBiz(bizList, bizName, fileName) {
146
+ function addBiz(bizList, bizName, fileName, check) {
147
147
  if (!bizName) return;
148
+
148
149
  try {
149
150
  var s = bizName.replaceAll("'", '"');
150
151
  var bizData = JSON.parse(s);
151
152
  bizName = bizData.Name;
152
- } catch (ex) { }
153
+ } catch (ex) {
154
+ if (!check) {
155
+ if (bizName.trim().startsWith('{')) { // jxc.{'Name':'btypeNew','PassEvent':true,'bcategory':${bcategory},'btypetype':'nofreight'}
156
+ var s = bizName.split(',')[0];
157
+ s += '}';
158
+ return addBiz(bizList, bizName, fileName, true);
159
+ }
160
+ }
161
+ }
153
162
 
154
- if (bizName.indexOf('.') < 0) {
163
+ if (bizName.indexOf('.') < 0 && bizName.indexOf('$') < 0) {
155
164
  bizName = config.modName + '.' + bizName;
156
165
  }
157
166
  if (!bizList[bizName]) {
package/tool/start.js CHANGED
@@ -76,7 +76,7 @@ class Start {
76
76
  initArgs() {
77
77
  var keys = [
78
78
  { name: '-webPath', type: '' }, // 网站路径
79
- { name: '-port', type: '' }, // 网站端口
79
+ { name: '-port', type: 'number' }, // 网站端口
80
80
  { name: '-modName', type: '' }, // ngp的服务、模块名称
81
81
  { name: '-virtualName', type: '' }, // 虚拟路径名
82
82
  { name: '-webhooks', type: '' }, // 检测报告推送的地址
@@ -151,6 +151,8 @@ class Start {
151
151
  } else if (key == 'proxySrc') {
152
152
  value = JSON.parse(File.readFileSync(value));
153
153
  key = 'proxy';
154
+ } else if (type == 'number') {
155
+ value = Number(value);
154
156
  }
155
157
  // 特殊处理大小写问题
156
158
  if (key == 'ignorecompress') {