@pxp-nd/core 1.2.3 → 1.2.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/PxpApp.js +8 -4
- package/dist/interfaces.d.ts +5 -0
- package/dist/lib/pxp/Controller.js +2 -3
- package/package.json +1 -1
package/dist/PxpApp.js
CHANGED
|
@@ -45,7 +45,7 @@ const modulesPxp = {
|
|
|
45
45
|
common: '@pxp-nd/common',
|
|
46
46
|
reports: '@pxp-nd/reports',
|
|
47
47
|
};
|
|
48
|
-
//auth configure
|
|
48
|
+
//auth configure
|
|
49
49
|
/**
|
|
50
50
|
*
|
|
51
51
|
* */
|
|
@@ -125,8 +125,12 @@ class PxpApp {
|
|
|
125
125
|
}
|
|
126
126
|
next();
|
|
127
127
|
});
|
|
128
|
-
this.app.use(express_1.default.json());
|
|
129
|
-
this.app.use(express_1.default.urlencoded({
|
|
128
|
+
this.app.use(express_1.default.json({ limit: '50mb' }));
|
|
129
|
+
this.app.use(express_1.default.urlencoded({ limit: '50mb' }));
|
|
130
|
+
/*this.app.use(express.json());
|
|
131
|
+
this.app.use(express.urlencoded({ extended: false }));
|
|
132
|
+
this.app.use(bodyParser.json({limit: '50mb'}));
|
|
133
|
+
this.app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));*/
|
|
130
134
|
this.app.use(express_fileupload_1.default({
|
|
131
135
|
limits: { fileSize: 5 * 1024 * 1024 },
|
|
132
136
|
}));
|
|
@@ -264,7 +268,7 @@ class PxpApp {
|
|
|
264
268
|
if (this.config.auth) {
|
|
265
269
|
await this.initializeAuthentication(this.configAuth);
|
|
266
270
|
}
|
|
267
|
-
// load ioServer
|
|
271
|
+
// load ioServer
|
|
268
272
|
this.loadIOserver();
|
|
269
273
|
// load controllers and routes
|
|
270
274
|
await this.loadControllers();
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -26,6 +26,9 @@ declare interface IModule {
|
|
|
26
26
|
declare interface IModules {
|
|
27
27
|
[name: string]: IModule;
|
|
28
28
|
}
|
|
29
|
+
declare interface IConfigExpress {
|
|
30
|
+
[name: string]: any;
|
|
31
|
+
}
|
|
29
32
|
export interface IConfigPxpApp {
|
|
30
33
|
defaultDbSettings?: string;
|
|
31
34
|
apiPrefix?: string;
|
|
@@ -40,5 +43,7 @@ export interface IConfigPxpApp {
|
|
|
40
43
|
scripts?: any[];
|
|
41
44
|
modules?: IModules;
|
|
42
45
|
enableSocket?: boolean;
|
|
46
|
+
expressJsonConfig?: IConfigExpress;
|
|
47
|
+
expressUrlEncodedConfig?: IConfigExpress;
|
|
43
48
|
}
|
|
44
49
|
export {};
|
|
@@ -121,7 +121,6 @@ class Controller {
|
|
|
121
121
|
const permission = Reflect.getMetadata('permission', this.constructor) || {};
|
|
122
122
|
// get log
|
|
123
123
|
const log = Reflect.getMetadata('log', this.constructor) || {};
|
|
124
|
-
console.log('qqqqqqw', log);
|
|
125
124
|
// get dbsettings
|
|
126
125
|
const dbsettings = Reflect.getMetadata('dbsettings', this.constructor) || {};
|
|
127
126
|
// get logConfig
|
|
@@ -172,7 +171,7 @@ class Controller {
|
|
|
172
171
|
const iniAt = req.start;
|
|
173
172
|
const endsAt = now.valueOf() - iniAt.valueOf();
|
|
174
173
|
res.logId = await index_1.__(index_1.insertLog('nouser', 'mac', req.ip, 'error', ex.tecMessage, this.module, this.transactionCode, '', // query
|
|
175
|
-
params, ex.stack, ex.statusCode, endsAt,
|
|
174
|
+
params, ex.stack, ex.statusCode, endsAt, logValue));
|
|
176
175
|
index_1.errorMiddleware(ex, req, res);
|
|
177
176
|
}
|
|
178
177
|
});
|
|
@@ -206,7 +205,7 @@ class Controller {
|
|
|
206
205
|
const iniAt = req.start;
|
|
207
206
|
const endsAt = now.valueOf() - iniAt.valueOf();
|
|
208
207
|
res.logId = (await index_1.__(index_1.insertLog(this.user && this.user.username ? this.user.username : 'nouser', 'mac', req.ip, 'error', ex.tecMessage, this.module, this.transactionCode, '', // query
|
|
209
|
-
params, ex.stack, ex.statusCode, endsAt,
|
|
208
|
+
params, ex.stack, ex.statusCode, endsAt, logValue)));
|
|
210
209
|
index_1.errorMiddleware(ex, req, res);
|
|
211
210
|
}
|
|
212
211
|
});
|