crabatool 1.0.815 → 1.0.817

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
@@ -160,6 +160,21 @@ function createServer(app, options) {
160
160
 
161
161
  app.webPath = webPath; // handler.js里面动态获取当前app的网站路径(多个server实例的时候需要)
162
162
 
163
+
164
+ // 业务ap的代理转发(可能转发静态资源,放到前面)
165
+ if (config.proxy) {
166
+ var { createProxyMiddleware } = require('http-proxy-middleware');
167
+ if (Array.isArray(config.proxy)) { // 兼容代理配置是数组
168
+ for (const item of config.proxy) {
169
+ app.use(createProxyMiddleware(item))
170
+ }
171
+ } else {
172
+ for (let key in config.proxy) {
173
+ app.use(key, createProxyMiddleware(config.proxy[key]));
174
+ }
175
+ }
176
+ }
177
+
163
178
  app.use(express.static(webPath, {
164
179
  maxage: '100h', // 强制缓存资源
165
180
  setHeaders: function(res, pathname, stat) {
@@ -180,20 +195,6 @@ function createServer(app, options) {
180
195
  }
181
196
  }));
182
197
 
183
- // 业务ap的代理转发
184
- if (config.proxy) {
185
- var { createProxyMiddleware } = require('http-proxy-middleware');
186
- if (Array.isArray(config.proxy)) { // 兼容代理配置是数组
187
- for (const item of config.proxy) {
188
- app.use(createProxyMiddleware(item))
189
- }
190
- } else {
191
- for (let key in config.proxy) {
192
- app.use(key, createProxyMiddleware(config.proxy[key]));
193
- }
194
- }
195
- }
196
-
197
198
  var bodyParser = require('body-parser');
198
199
  app.use(bodyParser.json(utils._getJsonDefaultOptions({})));
199
200
  app.use(bodyParser.raw(utils._getJsonDefaultOptions({})));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.815",
3
+ "version": "1.0.817",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "bin": {
package/tool/addNodeId.js CHANGED
@@ -559,7 +559,7 @@ function createAttributeInsertion(body, node, newId) {
559
559
  const tagName = node.name || '';
560
560
  const attrName = tagName.endsWith('Column') && tagName !== 'FlexColumn' ? 'Name' : 'ID';
561
561
 
562
- if (node.attribs && node.attribs[attrName]) {
562
+ if (node.attribs && (node.attribs[attrName] || (attrName === 'Name' && node.attribs.ExpandName))) {
563
563
  return null;
564
564
  }
565
565
 
@@ -620,7 +620,7 @@ const filter = (attrs, tagName) => {
620
620
  }
621
621
 
622
622
  if (tagName.endsWith('Column') && tagName !== 'FlexColumn') {
623
- return !!attrs.Name || !!attrs.DataField;;
623
+ return !!attrs.Name || !!attrs.DataField || !!attrs.ExpandName;
624
624
  }
625
625
 
626
626
  return !!attrs.ID || !!attrs.DataField;