midway-fatcms 0.0.1-beta.41 → 0.0.1-beta.42

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.
@@ -35,11 +35,7 @@ exports.default = (appInfo) => {
35
35
  jsonLimit: '10mb',
36
36
  textLimit: '10mb',
37
37
  xmlLimit: '10mb',
38
- ignore: [
39
- '/ns/gw/proxy/*',
40
- '/ns/gw/file/uploadFile',
41
- '/ns/api/manage/deploy/uploadAssets',
42
- ], // 忽略代理路径的 body 解析
38
+ ignore: ['/ns/gw/proxy/*', '/ns/gw/file/uploadFile', '/ns/api/manage/deploy/uploadAssets'], // 忽略代理路径的 body 解析
43
39
  },
44
40
  mysql2: {
45
41
  fatcms: {
@@ -115,34 +111,7 @@ exports.default = (appInfo) => {
115
111
  fileSize: '20mb',
116
112
  limit: '20mb',
117
113
  // whitelist: string[],文件扩展名白名单
118
- whitelist: [
119
- '.jpg',
120
- '.jpeg',
121
- '.png',
122
- '.gif',
123
- '.pdf',
124
- '.zip',
125
- '.xlsx',
126
- '.docx',
127
- '.pptx',
128
- '.txt',
129
- '.md',
130
- '.json',
131
- '.js',
132
- '.cjs',
133
- '.ejs',
134
- '.jsx',
135
- '.css',
136
- '.java',
137
- '.ts',
138
- '.tsx',
139
- '.less',
140
- '.scss',
141
- '.html',
142
- '.ttf',
143
- '.map',
144
- '.svg',
145
- ],
114
+ whitelist: ['.jpg', '.jpeg', '.png', '.gif', '.pdf', '.zip', '.xlsx', '.docx', '.pptx', '.txt', '.md', '.json', '.js', '.cjs', '.ejs', '.jsx', '.css', '.java', '.ts', '.tsx', '.less', '.scss', '.html', '.ttf', '.map', '.svg'],
146
115
  // tmpdir: string,上传的文件临时存储路径
147
116
  tmpdir: (0, path_1.join)((0, os_1.tmpdir)(), 'fatcms-upload-files'),
148
117
  // cleanTimeout: number,上传的文件在临时目录中多久之后自动删除,默认为 5 分钟
@@ -186,6 +155,6 @@ exports.default = (appInfo) => {
186
155
  // Excel导出文件的临时目录
187
156
  fatcmsExportExcelTmpFilePath: (0, path_1.join)((0, os_1.tmpdir)(), 'fatcms-export-excel'),
188
157
  // 在某些场景下,只有一个workbench code。如果启用了此配置,则不再根据域名配置识别Workbench.
189
- fatcmsTargetWorkbenchCode: null
158
+ fatcmsTargetWorkbenchCode: null,
190
159
  };
191
160
  };
@@ -34,6 +34,10 @@ interface IGlobalStaticConfig {
34
34
  toFatcmsUserAccountId(bizTableUserId: any): string;
35
35
  SystemDbName: string;
36
36
  SystemDbType: SqlDbType;
37
+ /**
38
+ * Excel导出时,每页查询的最大数量
39
+ */
40
+ maxPageSizeOfExportExcel: number;
37
41
  }
38
42
  declare class GlobalStaticConfig {
39
43
  private configObject;
@@ -17,6 +17,7 @@ class GlobalStaticConfig {
17
17
  },
18
18
  SystemDbName: 'fatcms',
19
19
  SystemDbType: keys_1.SqlDbType.mysql,
20
+ maxPageSizeOfExportExcel: 1000
20
21
  };
21
22
  }
22
23
  getConfig() {
@@ -6,6 +6,7 @@ const axios_1 = require("axios");
6
6
  const AsyncTaskModel_1 = require("../../../models/AsyncTaskModel");
7
7
  const schedule_1 = require("../../../schedule");
8
8
  const functions_1 = require("../../../libs/utils/functions");
9
+ const global_config_1 = require("../../../libs/global-config/global-config");
9
10
  function pickData(a, key) {
10
11
  if (a && typeof a.getResModel === 'function') {
11
12
  const s = a.getResModel();
@@ -29,8 +30,9 @@ class ExportExcelByInnerHttpHandler {
29
30
  this.appCode = this.inputParams.appCode;
30
31
  }
31
32
  async getPageSize() {
33
+ const maxPageSizeOfExportExcel = global_config_1.GLOBAL_STATIC_CONFIG.getConfig().maxPageSizeOfExportExcel;
32
34
  if (typeof this.inputParams.pageSize === 'number') {
33
- return Math.min(this.inputParams.pageSize, 1000);
35
+ return Math.min(this.inputParams.pageSize, maxPageSizeOfExportExcel);
34
36
  }
35
37
  return 1000;
36
38
  }
@@ -4,6 +4,7 @@ exports.ExportExcelByStdCrudHandler = void 0;
4
4
  const _ = require("lodash");
5
5
  const CrudStdService_1 = require("../../../service/crudstd/CrudStdService");
6
6
  const keys_1 = require("../../../libs/crud-pro/models/keys");
7
+ const global_config_1 = require("../../../libs/global-config/global-config");
7
8
  function pickData(a, key) {
8
9
  if (a && typeof a.getResModel === 'function') {
9
10
  const s = a.getResModel();
@@ -27,8 +28,9 @@ class ExportExcelByStdCrudHandler {
27
28
  this.appCode = this.inputParams.appCode;
28
29
  }
29
30
  async getPageSize() {
31
+ const maxPageSizeOfExportExcel = global_config_1.GLOBAL_STATIC_CONFIG.getConfig().maxPageSizeOfExportExcel;
30
32
  if (typeof this.inputParams.pageSize === 'number') {
31
- return Math.min(this.inputParams.pageSize, 1000);
33
+ return Math.min(this.inputParams.pageSize, maxPageSizeOfExportExcel);
32
34
  }
33
35
  return 1000;
34
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "midway-fatcms",
3
- "version": "0.0.1-beta.41",
3
+ "version": "0.0.1-beta.42",
4
4
  "description": "This is a midway component sample",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",