@xrystal/core 3.26.2 → 3.26.3
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/package.json
CHANGED
|
@@ -42,7 +42,7 @@ export class BaseController {
|
|
|
42
42
|
headers: ctx.headers || req.headers || ctx.request?.headers || {},
|
|
43
43
|
body,
|
|
44
44
|
query: query || {},
|
|
45
|
-
params,
|
|
45
|
+
params: params || {},
|
|
46
46
|
lang: ctx.lang || req.lang || 'en',
|
|
47
47
|
t: ctx.t || req.t || identityT,
|
|
48
48
|
accounts: ctx.accounts || req.accounts || ctx.user
|
|
@@ -113,7 +113,6 @@ export default class Controller extends BaseController {
|
|
|
113
113
|
try {
|
|
114
114
|
const rawReq = store?.req || store?.ctx?.request || store?.ctx?.req;
|
|
115
115
|
let parsedBody = this.req.body;
|
|
116
|
-
let parsedQuery = this.req.query;
|
|
117
116
|
const contentType = (this.req.headers['content-type'] || '').toLowerCase();
|
|
118
117
|
const consumeBody = async (bodySource) => {
|
|
119
118
|
let text = '';
|
|
@@ -194,10 +193,17 @@ export default class Controller extends BaseController {
|
|
|
194
193
|
if (!store.metadata)
|
|
195
194
|
store.metadata = { locals: {} };
|
|
196
195
|
store.metadata._parsedBody = parsedBody || {};
|
|
197
|
-
store.metadata._parsedQuery =
|
|
196
|
+
store.metadata._parsedQuery = this.req.query;
|
|
198
197
|
}
|
|
199
198
|
const currentReq = this.req;
|
|
200
|
-
const p = {
|
|
199
|
+
const p = {
|
|
200
|
+
req: currentReq,
|
|
201
|
+
res: currentRes,
|
|
202
|
+
body: currentReq.body,
|
|
203
|
+
queries: currentReq.query,
|
|
204
|
+
params: currentReq.params,
|
|
205
|
+
t: currentReq.t,
|
|
206
|
+
};
|
|
201
207
|
const extractMeta = (obj) => {
|
|
202
208
|
if (!obj || typeof obj !== 'object')
|
|
203
209
|
return;
|