midway-fatcms 0.0.1-beta.4 → 0.0.1-beta.6
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/dist/config/config.default.js +48 -11
- package/dist/controller/manage/CrudStandardDesignApi.js +83 -68
- package/dist/controller/manage/UserAccountManageApi.d.ts +1 -1
- package/dist/index.d.ts +26 -4
- package/dist/index.js +26 -4
- package/package.json +1 -1
- package/src/config/config.default.ts +54 -23
- package/src/controller/home.controller.ts +6 -6
- package/src/controller/manage/CrudStandardDesignApi.ts +139 -94
- package/src/index.ts +32 -4
- package/dist/controller/medstatistic/MedAdminController.d.ts +0 -35
- package/dist/controller/medstatistic/MedAdminController.js +0 -205
- package/dist/controller/medstatistic/MedClientController.d.ts +0 -28
- package/dist/controller/medstatistic/MedClientController.js +0 -188
- package/dist/controller/medstatistic/MedMessageService.d.ts +0 -19
- package/dist/controller/medstatistic/MedMessageService.js +0 -95
- package/dist/controller/medstatistic/MedScoreService.d.ts +0 -21
- package/dist/controller/medstatistic/MedScoreService.js +0 -107
- package/dist/controller/medstatistic/constants.d.ts +0 -32
- package/dist/controller/medstatistic/constants.js +0 -43
- package/src/controller/medstatistic/MedAdminController.ts +0 -221
- package/src/controller/medstatistic/MedClientController.ts +0 -188
- package/src/controller/medstatistic/MedMessageService.ts +0 -89
- package/src/controller/medstatistic/MedScoreService.ts +0 -108
- package/src/controller/medstatistic/constants.ts +0 -63
|
@@ -13,7 +13,13 @@ exports.default = (appInfo) => {
|
|
|
13
13
|
* 内置超级管理员用户
|
|
14
14
|
* 可以使用这个工具生成:http://127.0.0.1:7002/ns/api/helpers/generateDatabasePassword?loginName=xxxx&pw0=xxxx
|
|
15
15
|
*/
|
|
16
|
-
superAdminList: [
|
|
16
|
+
superAdminList: [
|
|
17
|
+
{
|
|
18
|
+
pwd_salt: 'c837f8c6de7261de228ec58b1b3ca9fa1htbvgm88',
|
|
19
|
+
pwd_md5: 'e334410fca1fd49972f63bf91f3be1be',
|
|
20
|
+
login_name: 'superadmin',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
17
23
|
// use for cookie sign key, should change to your own and keep security
|
|
18
24
|
keys: '1715169944707_323',
|
|
19
25
|
koa: {
|
|
@@ -29,7 +35,11 @@ exports.default = (appInfo) => {
|
|
|
29
35
|
jsonLimit: '1mb',
|
|
30
36
|
textLimit: '1mb',
|
|
31
37
|
xmlLimit: '1mb',
|
|
32
|
-
ignore: [
|
|
38
|
+
ignore: [
|
|
39
|
+
'/ns/gw/proxy/*',
|
|
40
|
+
'/ns/gw/file/uploadFile',
|
|
41
|
+
'/ns/api/manage/deploy/uploadAssets',
|
|
42
|
+
], // 忽略代理路径的 body 解析
|
|
33
43
|
},
|
|
34
44
|
mysql2: {
|
|
35
45
|
fatcms: {
|
|
@@ -45,7 +55,7 @@ exports.default = (appInfo) => {
|
|
|
45
55
|
},
|
|
46
56
|
},
|
|
47
57
|
postgres2: {
|
|
48
|
-
|
|
58
|
+
postgres_test_fatcms_inner_demo_config: {
|
|
49
59
|
user: 'postgres',
|
|
50
60
|
host: '127.0.0.1',
|
|
51
61
|
database: 'postgres',
|
|
@@ -54,10 +64,10 @@ exports.default = (appInfo) => {
|
|
|
54
64
|
max: 20,
|
|
55
65
|
idleTimeoutMillis: 30000,
|
|
56
66
|
connectionTimeoutMillis: 2000, // 连接超时时间(毫秒)
|
|
57
|
-
}
|
|
67
|
+
},
|
|
58
68
|
},
|
|
59
69
|
sqlserver2: {
|
|
60
|
-
|
|
70
|
+
sqlserver_master_fatcms_inner_demo_config: {
|
|
61
71
|
user: 'sa',
|
|
62
72
|
password: '123456',
|
|
63
73
|
server: '127.0.0.1',
|
|
@@ -65,19 +75,19 @@ exports.default = (appInfo) => {
|
|
|
65
75
|
database: 'master',
|
|
66
76
|
options: {
|
|
67
77
|
encrypt: false,
|
|
68
|
-
trustServerCertificate: true // 信任自签名证书
|
|
78
|
+
trustServerCertificate: true, // 信任自签名证书
|
|
69
79
|
},
|
|
70
80
|
pool: {
|
|
71
81
|
max: 30,
|
|
72
82
|
min: 1,
|
|
73
|
-
idleTimeoutMillis: 30000 // 连接空闲超时时间(毫秒)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
83
|
+
idleTimeoutMillis: 30000, // 连接空闲超时时间(毫秒)
|
|
84
|
+
},
|
|
85
|
+
},
|
|
76
86
|
},
|
|
77
87
|
redis: {
|
|
78
88
|
client: {
|
|
79
89
|
port: 6379,
|
|
80
|
-
host:
|
|
90
|
+
host: '127.0.0.1', // Redis host
|
|
81
91
|
},
|
|
82
92
|
},
|
|
83
93
|
oss: {
|
|
@@ -105,7 +115,34 @@ exports.default = (appInfo) => {
|
|
|
105
115
|
fileSize: '20mb',
|
|
106
116
|
limit: '20mb',
|
|
107
117
|
// whitelist: string[],文件扩展名白名单
|
|
108
|
-
whitelist: [
|
|
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
|
+
],
|
|
109
146
|
// tmpdir: string,上传的文件临时存储路径
|
|
110
147
|
tmpdir: (0, path_1.join)((0, os_1.tmpdir)(), 'fatcms-upload-files'),
|
|
111
148
|
// cleanTimeout: number,上传的文件在临时目录中多久之后自动删除,默认为 5 分钟
|
|
@@ -26,8 +26,7 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
26
26
|
const postgresList = Object.keys(this.postgres2Config || {});
|
|
27
27
|
const sqlServerList = Object.keys(this.sqlserver2Config || {});
|
|
28
28
|
const toSelectList = (dbCfgNameList, dbType) => {
|
|
29
|
-
return dbCfgNameList.map(
|
|
30
|
-
const dbName = item;
|
|
29
|
+
return dbCfgNameList.map(dbName => {
|
|
31
30
|
const value = (0, DatabaseName_1.toDatabaseNameStr)(dbType, dbName);
|
|
32
31
|
return { value, label: value, dbName, dbType };
|
|
33
32
|
});
|
|
@@ -35,7 +34,14 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
35
34
|
const mysqlObjList = toSelectList(mysqlList, keys_1.SqlDbType.mysql);
|
|
36
35
|
const postgresObjList = toSelectList(postgresList, keys_1.SqlDbType.postgres);
|
|
37
36
|
const sqlserverObjList = toSelectList(sqlServerList, keys_1.SqlDbType.sqlserver);
|
|
38
|
-
const databaseList = [
|
|
37
|
+
const databaseList = [
|
|
38
|
+
...mysqlObjList,
|
|
39
|
+
...postgresObjList,
|
|
40
|
+
...sqlserverObjList,
|
|
41
|
+
].filter((obj) => {
|
|
42
|
+
const value = '' + obj.value;
|
|
43
|
+
return !value.endsWith('_fatcms_inner_demo_config');
|
|
44
|
+
});
|
|
39
45
|
return {
|
|
40
46
|
success: true,
|
|
41
47
|
data: databaseList,
|
|
@@ -131,13 +137,10 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
131
137
|
async getTableListOfSqlserver(dbName) {
|
|
132
138
|
const dbConfig = this.sqlserver2Config[dbName];
|
|
133
139
|
if (!dbConfig) {
|
|
134
|
-
throw new exceptions_1.CommonException(
|
|
140
|
+
throw new exceptions_1.CommonException('DB_NOT_FOUND', '数据库配置没有找到:' + dbName);
|
|
135
141
|
}
|
|
136
142
|
const dbType = keys_1.SqlDbType.sqlserver;
|
|
137
|
-
const sql =
|
|
138
|
-
"SELECT name as tablename \n" +
|
|
139
|
-
"FROM sys.tables" +
|
|
140
|
-
"";
|
|
143
|
+
const sql = 'SELECT name as tablename FROM sys.tables';
|
|
141
144
|
const arr = await this.curdMixService.executeSQL({
|
|
142
145
|
executeSql: sql,
|
|
143
146
|
sqlDatabase: dbName,
|
|
@@ -150,8 +153,9 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
150
153
|
return {
|
|
151
154
|
value: tableName,
|
|
152
155
|
label: tableName,
|
|
153
|
-
dbName,
|
|
154
|
-
|
|
156
|
+
dbName,
|
|
157
|
+
dbType,
|
|
158
|
+
tableName,
|
|
155
159
|
};
|
|
156
160
|
});
|
|
157
161
|
return common_dto_1.CommonResult.successRes(tableNames);
|
|
@@ -159,65 +163,76 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
159
163
|
async getTableListOfPostgreSQL(dbName) {
|
|
160
164
|
const dbConfig = this.postgres2Config[dbName];
|
|
161
165
|
if (!dbConfig) {
|
|
162
|
-
throw new exceptions_1.CommonException(
|
|
166
|
+
throw new exceptions_1.CommonException('DB_NOT_FOUND', '数据库配置没有找到:' + dbName);
|
|
163
167
|
}
|
|
164
|
-
const schemaname = "public";
|
|
165
|
-
const sql = "" +
|
|
166
|
-
"SELECT tablename\n" +
|
|
167
|
-
"FROM pg_tables\n" +
|
|
168
|
-
`WHERE schemaname = '${schemaname}' \n` +
|
|
169
|
-
"ORDER BY tablename;";
|
|
170
168
|
const dbType = keys_1.SqlDbType.postgres;
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
169
|
+
const schemaname = 'public';
|
|
170
|
+
const tableListSql = '' +
|
|
171
|
+
'SELECT tablename\n' +
|
|
172
|
+
'FROM pg_tables\n' +
|
|
173
|
+
`WHERE schemaname = '${schemaname}' \n` +
|
|
174
|
+
'ORDER BY tablename;';
|
|
175
|
+
const viewListSql = '' +
|
|
176
|
+
'SELECT viewname as tablename\n' +
|
|
177
|
+
'FROM pg_views\n' +
|
|
178
|
+
`WHERE schemaname = '${schemaname}' \n` +
|
|
179
|
+
'ORDER BY viewname;';
|
|
180
|
+
const toSelectOptions = async (executeSql, tableType) => {
|
|
181
|
+
const arr = await this.curdMixService.executeSQL({
|
|
182
|
+
executeSql: executeSql,
|
|
183
|
+
sqlDatabase: dbName,
|
|
184
|
+
sqlDdType: dbType,
|
|
185
|
+
crudType: keys_1.KeyOfCrudTypes.SYS_QUERY,
|
|
186
|
+
executeSqlArgs: [],
|
|
187
|
+
});
|
|
188
|
+
return arr.map(v => {
|
|
189
|
+
const tableName = v.tablename;
|
|
190
|
+
return {
|
|
191
|
+
value: tableName,
|
|
192
|
+
label: tableName,
|
|
193
|
+
dbName,
|
|
194
|
+
dbType,
|
|
195
|
+
tableName,
|
|
196
|
+
tableType,
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
const tableNames = await toSelectOptions(tableListSql, 'table');
|
|
201
|
+
const viewNames = await toSelectOptions(viewListSql, 'view');
|
|
202
|
+
const tableNameMerge = [...tableNames, ...viewNames];
|
|
203
|
+
return common_dto_1.CommonResult.successRes(tableNameMerge);
|
|
188
204
|
}
|
|
189
205
|
async getTableFieldsOfSqlServer(dbName, tableName) {
|
|
190
206
|
const dbConfig = this.sqlserver2Config[dbName];
|
|
191
207
|
if (!dbConfig) {
|
|
192
|
-
throw new exceptions_1.CommonException(
|
|
208
|
+
throw new exceptions_1.CommonException('DB_NOT_FOUND', '数据库配置没有找到:' + dbName);
|
|
193
209
|
}
|
|
194
|
-
const columnArraySql =
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
"WHERE\n" +
|
|
210
|
+
const columnArraySql = '' +
|
|
211
|
+
'SELECT\n' +
|
|
212
|
+
' c.name AS column_name,\n' +
|
|
213
|
+
' t.name AS data_type,\n' +
|
|
214
|
+
' c.max_length AS max_length,\n' +
|
|
215
|
+
' c.precision,\n' +
|
|
216
|
+
' c.scale,\n' +
|
|
217
|
+
' c.is_nullable,\n' +
|
|
218
|
+
' c.is_identity,\n' +
|
|
219
|
+
' dc.definition AS column_default, \n' +
|
|
220
|
+
' ep.value AS column_description \n' +
|
|
221
|
+
'FROM\n' +
|
|
222
|
+
' sys.columns c\n' +
|
|
223
|
+
' JOIN\n' +
|
|
224
|
+
' sys.types t ON c.user_type_id = t.user_type_id\n' +
|
|
225
|
+
' LEFT JOIN\n' +
|
|
226
|
+
' sys.default_constraints dc\n' +
|
|
227
|
+
' ON c.default_object_id = dc.object_id \n' +
|
|
228
|
+
' LEFT JOIN\n' +
|
|
229
|
+
' sys.extended_properties ep\n' +
|
|
230
|
+
' ON c.object_id = ep.major_id\n' +
|
|
231
|
+
' AND c.column_id = ep.minor_id\n' +
|
|
232
|
+
'WHERE\n' +
|
|
218
233
|
` c.object_id = OBJECT_ID('${tableName}') \n` +
|
|
219
|
-
|
|
220
|
-
|
|
234
|
+
' ORDER BY\n' +
|
|
235
|
+
' c.column_id;';
|
|
221
236
|
const dbType = keys_1.SqlDbType.sqlserver;
|
|
222
237
|
const columnArray = await this.curdMixService.executeSQL({
|
|
223
238
|
executeSql: columnArraySql,
|
|
@@ -232,11 +247,11 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
232
247
|
fieldIndex: column_name || '',
|
|
233
248
|
fieldTitle: column_description || column_name || '',
|
|
234
249
|
isNullable: is_nullable,
|
|
235
|
-
defaultValue: column_default ||
|
|
250
|
+
defaultValue: column_default || '',
|
|
236
251
|
extra: others,
|
|
237
252
|
// key: column_name, // 索引
|
|
238
253
|
type: data_type,
|
|
239
|
-
is_identity: is_identity
|
|
254
|
+
is_identity: is_identity,
|
|
240
255
|
};
|
|
241
256
|
});
|
|
242
257
|
return common_dto_1.CommonResult.successRes({
|
|
@@ -248,9 +263,9 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
248
263
|
async getTableFieldsOfPostgreSQL(dbName, tableName) {
|
|
249
264
|
const dbConfig = this.postgres2Config[dbName];
|
|
250
265
|
if (!dbConfig) {
|
|
251
|
-
throw new exceptions_1.CommonException(
|
|
266
|
+
throw new exceptions_1.CommonException('DB_NOT_FOUND', '数据库配置没有找到:' + dbName);
|
|
252
267
|
}
|
|
253
|
-
const schemaname =
|
|
268
|
+
const schemaname = 'public';
|
|
254
269
|
const columnArraySql = `
|
|
255
270
|
|
|
256
271
|
SELECT
|
|
@@ -259,7 +274,7 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
259
274
|
WHERE table_schema = $1 and table_name = $2
|
|
260
275
|
ORDER BY ordinal_position;
|
|
261
276
|
|
|
262
|
-
`.trim();
|
|
277
|
+
`.trim();
|
|
263
278
|
const dbType = keys_1.SqlDbType.postgres;
|
|
264
279
|
const columnArray = await this.curdMixService.executeSQL({
|
|
265
280
|
executeSql: columnArraySql,
|
|
@@ -274,11 +289,11 @@ let CrudStandardDesignApi = class CrudStandardDesignApi extends BaseApiControlle
|
|
|
274
289
|
fieldIndex: column_name || '',
|
|
275
290
|
fieldTitle: column_name || '',
|
|
276
291
|
isNullable: is_nullable,
|
|
277
|
-
defaultValue: column_default ||
|
|
292
|
+
defaultValue: column_default || '',
|
|
278
293
|
extra: others,
|
|
279
294
|
// key: column_name, // 索引
|
|
280
295
|
type: data_type,
|
|
281
|
-
is_identity: is_identity
|
|
296
|
+
is_identity: is_identity,
|
|
282
297
|
};
|
|
283
298
|
});
|
|
284
299
|
return {
|
package/dist/index.d.ts
CHANGED
|
@@ -30,10 +30,6 @@ export * from './controller/manage/SysConfigMangeApi';
|
|
|
30
30
|
export * from './controller/manage/SystemInfoManageApi';
|
|
31
31
|
export * from './controller/manage/UserAccountManageApi';
|
|
32
32
|
export * from './controller/manage/WorkbenchMangeApi';
|
|
33
|
-
export * from './controller/medstatistic/MedAdminController';
|
|
34
|
-
export * from './controller/medstatistic/MedClientController';
|
|
35
|
-
export * from './controller/medstatistic/MedMessageService';
|
|
36
|
-
export * from './controller/medstatistic/MedScoreService';
|
|
37
33
|
export * from './controller/myinfo/AuthController';
|
|
38
34
|
export * from './controller/myinfo/MyInfoController';
|
|
39
35
|
export * from './controller/render/AppRenderController';
|
|
@@ -69,3 +65,29 @@ export * from './service/curd/CurdMixService';
|
|
|
69
65
|
export * from './service/curd/CurdProService';
|
|
70
66
|
export * from './service/proxyapi/ProxyApiLoadService';
|
|
71
67
|
export * from './service/proxyapi/ProxyApiService';
|
|
68
|
+
export * from './models/userSession';
|
|
69
|
+
export * from './models/bizmodels';
|
|
70
|
+
export * from './models/SystemEntities';
|
|
71
|
+
export * from './models/SystemPerm';
|
|
72
|
+
export * from './models/contextLogger';
|
|
73
|
+
export * from './models/devops';
|
|
74
|
+
export * from './models/SystemTables';
|
|
75
|
+
export * from './libs/utils/common-dto';
|
|
76
|
+
export * from './libs/utils/crypto-utils';
|
|
77
|
+
export * from './libs/utils/fatcms-request';
|
|
78
|
+
export * from './libs/utils/functions';
|
|
79
|
+
export * from './libs/utils/ordernum-utils';
|
|
80
|
+
export * from './libs/utils/parseConfig';
|
|
81
|
+
export * from './libs/crud-pro/CrudPro';
|
|
82
|
+
export * from './libs/crud-pro/defaultConfigs';
|
|
83
|
+
export * from './libs/crud-pro/exceptions';
|
|
84
|
+
export * from './libs/crud-pro/interfaces';
|
|
85
|
+
export * from './libs/crud-pro/models/ExecuteContext';
|
|
86
|
+
export * from './libs/crud-pro/models/FuncContext';
|
|
87
|
+
export * from './libs/crud-pro/models/RequestModel';
|
|
88
|
+
export * from './libs/crud-pro/models/SqlCfgModel';
|
|
89
|
+
export * from './libs/crud-pro/models/Transaction';
|
|
90
|
+
export * from './libs/crud-pro/models/keys';
|
|
91
|
+
export * from './libs/crud-pro/models/ExecuteContextFunc';
|
|
92
|
+
export * from './libs/crud-pro/models/RequestCfgModel';
|
|
93
|
+
export * from './libs/crud-pro/models/SqlSegArg';
|
package/dist/index.js
CHANGED
|
@@ -48,10 +48,6 @@ __exportStar(require("./controller/manage/SysConfigMangeApi"), exports);
|
|
|
48
48
|
__exportStar(require("./controller/manage/SystemInfoManageApi"), exports);
|
|
49
49
|
__exportStar(require("./controller/manage/UserAccountManageApi"), exports);
|
|
50
50
|
__exportStar(require("./controller/manage/WorkbenchMangeApi"), exports);
|
|
51
|
-
__exportStar(require("./controller/medstatistic/MedAdminController"), exports);
|
|
52
|
-
__exportStar(require("./controller/medstatistic/MedClientController"), exports);
|
|
53
|
-
__exportStar(require("./controller/medstatistic/MedMessageService"), exports);
|
|
54
|
-
__exportStar(require("./controller/medstatistic/MedScoreService"), exports);
|
|
55
51
|
__exportStar(require("./controller/myinfo/AuthController"), exports);
|
|
56
52
|
__exportStar(require("./controller/myinfo/MyInfoController"), exports);
|
|
57
53
|
__exportStar(require("./controller/render/AppRenderController"), exports);
|
|
@@ -87,3 +83,29 @@ __exportStar(require("./service/curd/CurdMixService"), exports);
|
|
|
87
83
|
__exportStar(require("./service/curd/CurdProService"), exports);
|
|
88
84
|
__exportStar(require("./service/proxyapi/ProxyApiLoadService"), exports);
|
|
89
85
|
__exportStar(require("./service/proxyapi/ProxyApiService"), exports);
|
|
86
|
+
__exportStar(require("./models/userSession"), exports);
|
|
87
|
+
__exportStar(require("./models/bizmodels"), exports);
|
|
88
|
+
__exportStar(require("./models/SystemEntities"), exports);
|
|
89
|
+
__exportStar(require("./models/SystemPerm"), exports);
|
|
90
|
+
__exportStar(require("./models/contextLogger"), exports);
|
|
91
|
+
__exportStar(require("./models/devops"), exports);
|
|
92
|
+
__exportStar(require("./models/SystemTables"), exports);
|
|
93
|
+
__exportStar(require("./libs/utils/common-dto"), exports);
|
|
94
|
+
__exportStar(require("./libs/utils/crypto-utils"), exports);
|
|
95
|
+
__exportStar(require("./libs/utils/fatcms-request"), exports);
|
|
96
|
+
__exportStar(require("./libs/utils/functions"), exports);
|
|
97
|
+
__exportStar(require("./libs/utils/ordernum-utils"), exports);
|
|
98
|
+
__exportStar(require("./libs/utils/parseConfig"), exports);
|
|
99
|
+
__exportStar(require("./libs/crud-pro/CrudPro"), exports);
|
|
100
|
+
__exportStar(require("./libs/crud-pro/defaultConfigs"), exports);
|
|
101
|
+
__exportStar(require("./libs/crud-pro/exceptions"), exports);
|
|
102
|
+
__exportStar(require("./libs/crud-pro/interfaces"), exports);
|
|
103
|
+
__exportStar(require("./libs/crud-pro/models/ExecuteContext"), exports);
|
|
104
|
+
__exportStar(require("./libs/crud-pro/models/FuncContext"), exports);
|
|
105
|
+
__exportStar(require("./libs/crud-pro/models/RequestModel"), exports);
|
|
106
|
+
__exportStar(require("./libs/crud-pro/models/SqlCfgModel"), exports);
|
|
107
|
+
__exportStar(require("./libs/crud-pro/models/Transaction"), exports);
|
|
108
|
+
__exportStar(require("./libs/crud-pro/models/keys"), exports);
|
|
109
|
+
__exportStar(require("./libs/crud-pro/models/ExecuteContextFunc"), exports);
|
|
110
|
+
__exportStar(require("./libs/crud-pro/models/RequestCfgModel"), exports);
|
|
111
|
+
__exportStar(require("./libs/crud-pro/models/SqlSegArg"), exports);
|
package/package.json
CHANGED
|
@@ -3,24 +3,25 @@ import { tmpdir } from 'os';
|
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { readFileSync } from 'fs';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
6
|
export default (appInfo: any) => {
|
|
9
7
|
return {
|
|
10
|
-
|
|
11
8
|
siteFile: {
|
|
12
9
|
favicon: readFileSync(join(__dirname, '../views/static/favicon.ico')),
|
|
13
10
|
},
|
|
14
11
|
|
|
15
|
-
encryptedFieldList: [
|
|
16
|
-
|
|
17
|
-
],
|
|
12
|
+
encryptedFieldList: [],
|
|
18
13
|
|
|
19
14
|
/**
|
|
20
15
|
* 内置超级管理员用户
|
|
21
16
|
* 可以使用这个工具生成:http://127.0.0.1:7002/ns/api/helpers/generateDatabasePassword?loginName=xxxx&pw0=xxxx
|
|
22
17
|
*/
|
|
23
|
-
superAdminList: [
|
|
18
|
+
superAdminList: [
|
|
19
|
+
{
|
|
20
|
+
pwd_salt: 'c837f8c6de7261de228ec58b1b3ca9fa1htbvgm88',
|
|
21
|
+
pwd_md5: 'e334410fca1fd49972f63bf91f3be1be',
|
|
22
|
+
login_name: 'superadmin',
|
|
23
|
+
},
|
|
24
|
+
],
|
|
24
25
|
|
|
25
26
|
// use for cookie sign key, should change to your own and keep security
|
|
26
27
|
keys: '1715169944707_323',
|
|
@@ -40,7 +41,11 @@ export default (appInfo: any) => {
|
|
|
40
41
|
jsonLimit: '1mb',
|
|
41
42
|
textLimit: '1mb',
|
|
42
43
|
xmlLimit: '1mb',
|
|
43
|
-
ignore: [
|
|
44
|
+
ignore: [
|
|
45
|
+
'/ns/gw/proxy/*',
|
|
46
|
+
'/ns/gw/file/uploadFile',
|
|
47
|
+
'/ns/api/manage/deploy/uploadAssets',
|
|
48
|
+
], // 忽略代理路径的 body 解析
|
|
44
49
|
},
|
|
45
50
|
|
|
46
51
|
mysql2: {
|
|
@@ -57,7 +62,7 @@ export default (appInfo: any) => {
|
|
|
57
62
|
},
|
|
58
63
|
},
|
|
59
64
|
postgres2: {
|
|
60
|
-
|
|
65
|
+
postgres_test_fatcms_inner_demo_config: {
|
|
61
66
|
user: 'postgres',
|
|
62
67
|
host: '127.0.0.1',
|
|
63
68
|
database: 'postgres',
|
|
@@ -66,12 +71,11 @@ export default (appInfo: any) => {
|
|
|
66
71
|
max: 20, // 连接池最大连接数
|
|
67
72
|
idleTimeoutMillis: 30000, // 空闲连接超时时间(毫秒)
|
|
68
73
|
connectionTimeoutMillis: 2000, // 连接超时时间(毫秒)
|
|
69
|
-
}
|
|
74
|
+
},
|
|
70
75
|
},
|
|
71
76
|
|
|
72
|
-
|
|
73
77
|
sqlserver2: {
|
|
74
|
-
|
|
78
|
+
sqlserver_master_fatcms_inner_demo_config: {
|
|
75
79
|
user: 'sa',
|
|
76
80
|
password: '123456', // 你的SA密码
|
|
77
81
|
server: '127.0.0.1',
|
|
@@ -79,20 +83,20 @@ export default (appInfo: any) => {
|
|
|
79
83
|
database: 'master', // 默认数据库
|
|
80
84
|
options: {
|
|
81
85
|
encrypt: false, // Docker容器内通常不需要加密
|
|
82
|
-
trustServerCertificate: true // 信任自签名证书
|
|
86
|
+
trustServerCertificate: true, // 信任自签名证书
|
|
83
87
|
},
|
|
84
88
|
pool: {
|
|
85
|
-
max: 30,
|
|
86
|
-
min: 1,
|
|
87
|
-
idleTimeoutMillis: 30000
|
|
88
|
-
}
|
|
89
|
-
}
|
|
89
|
+
max: 30, // 最大连接数
|
|
90
|
+
min: 1, // 最小连接数
|
|
91
|
+
idleTimeoutMillis: 30000, // 连接空闲超时时间(毫秒)
|
|
92
|
+
},
|
|
93
|
+
},
|
|
90
94
|
},
|
|
91
95
|
|
|
92
96
|
redis: {
|
|
93
97
|
client: {
|
|
94
98
|
port: 6379, // Redis port
|
|
95
|
-
host:
|
|
99
|
+
host: '127.0.0.1', // Redis host
|
|
96
100
|
},
|
|
97
101
|
},
|
|
98
102
|
|
|
@@ -122,7 +126,34 @@ export default (appInfo: any) => {
|
|
|
122
126
|
fileSize: '20mb',
|
|
123
127
|
limit: '20mb',
|
|
124
128
|
// whitelist: string[],文件扩展名白名单
|
|
125
|
-
whitelist: [
|
|
129
|
+
whitelist: [
|
|
130
|
+
'.jpg',
|
|
131
|
+
'.jpeg',
|
|
132
|
+
'.png',
|
|
133
|
+
'.gif',
|
|
134
|
+
'.pdf',
|
|
135
|
+
'.zip',
|
|
136
|
+
'.xlsx',
|
|
137
|
+
'.docx',
|
|
138
|
+
'.pptx',
|
|
139
|
+
'.txt',
|
|
140
|
+
'.md',
|
|
141
|
+
'.json',
|
|
142
|
+
'.js',
|
|
143
|
+
'.cjs',
|
|
144
|
+
'.ejs',
|
|
145
|
+
'.jsx',
|
|
146
|
+
'.css',
|
|
147
|
+
'.java',
|
|
148
|
+
'.ts',
|
|
149
|
+
'.tsx',
|
|
150
|
+
'.less',
|
|
151
|
+
'.scss',
|
|
152
|
+
'.html',
|
|
153
|
+
'.ttf',
|
|
154
|
+
'.map',
|
|
155
|
+
'.svg',
|
|
156
|
+
],
|
|
126
157
|
// tmpdir: string,上传的文件临时存储路径
|
|
127
158
|
tmpdir: join(tmpdir(), 'fatcms-upload-files'),
|
|
128
159
|
// cleanTimeout: number,上传的文件在临时目录中多久之后自动删除,默认为 5 分钟
|
|
@@ -148,7 +179,9 @@ export default (appInfo: any) => {
|
|
|
148
179
|
ejs: {},
|
|
149
180
|
|
|
150
181
|
info: {
|
|
151
|
-
infoPath: `/_my_info_${Date.now()}_${Math.floor(
|
|
182
|
+
infoPath: `/_my_info_${Date.now()}_${Math.floor(
|
|
183
|
+
Math.random() * 1000000
|
|
184
|
+
)}`, // 实际上隐藏了info路径
|
|
152
185
|
},
|
|
153
186
|
|
|
154
187
|
// 使用浏览器插件配置header信息:插件名:ModHeader - Modify HTTP headers
|
|
@@ -166,7 +199,5 @@ export default (appInfo: any) => {
|
|
|
166
199
|
|
|
167
200
|
// 是否启用内置的定时任务
|
|
168
201
|
fatcmsScheduleService: true,
|
|
169
|
-
|
|
170
|
-
|
|
171
202
|
} as MidwayConfig;
|
|
172
203
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {Controller, Get, Inject} from '@midwayjs/core';
|
|
2
|
-
import {Context} from '@midwayjs/koa';
|
|
3
|
-
import {BaseApiController} from './base/BaseApiController';
|
|
4
|
-
import {WorkbenchService} from '../service/WorkbenchService';
|
|
5
|
-
import {createRenderUtils} from "../libs/utils/render-utils";
|
|
6
|
-
import {privateAES} from "../libs/utils/crypto-utils";
|
|
1
|
+
import { Controller, Get, Inject } from '@midwayjs/core';
|
|
2
|
+
import { Context } from '@midwayjs/koa';
|
|
3
|
+
import { BaseApiController } from './base/BaseApiController';
|
|
4
|
+
import { WorkbenchService } from '../service/WorkbenchService';
|
|
5
|
+
import { createRenderUtils } from "../libs/utils/render-utils";
|
|
6
|
+
import { privateAES } from "../libs/utils/crypto-utils";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|