@midwayjs/web 3.13.1 → 3.13.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/app/extend/request.js +4 -1
- package/dist/interface.d.ts +5 -0
- package/dist/logger.js +3 -5
- package/package.json +2 -2
package/app/extend/request.js
CHANGED
|
@@ -15,7 +15,10 @@ module.exports = {
|
|
|
15
15
|
if (this.app.config.egg.queryParseMode === 'simple') {
|
|
16
16
|
const str = this.querystring;
|
|
17
17
|
const c = (this._querycache = this._querycache || {});
|
|
18
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
c[str] ||
|
|
20
|
+
(c[str] = qs.parse(str, this.app.config.egg.queryParseOptions || {}))
|
|
21
|
+
);
|
|
19
22
|
} else {
|
|
20
23
|
return this._customQuery(_querycache, firstValue);
|
|
21
24
|
}
|
package/dist/interface.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Context as EggContext, Application as EggApplication } from 'egg';
|
|
|
3
3
|
import { IMidwayContainer, IMidwayContext, IMidwayApplication, IConfigurationOptions, NextFunction as BaseNextFunction } from '@midwayjs/core';
|
|
4
4
|
import { DefaultState, Middleware } from 'koa';
|
|
5
5
|
import { ILogger, LoggerOptions } from '@midwayjs/logger';
|
|
6
|
+
import { IParseOptions } from 'qs';
|
|
6
7
|
export declare const RUN_IN_AGENT_KEY = "egg:run_in_agent";
|
|
7
8
|
export declare const EGG_AGENT_APP_KEY = "egg_agent_app";
|
|
8
9
|
export interface State extends DefaultState {
|
|
@@ -110,6 +111,10 @@ export interface IMidwayWebConfigurationOptions extends IConfigurationOptions {
|
|
|
110
111
|
* http query parser mode, default is extended
|
|
111
112
|
*/
|
|
112
113
|
queryParseMode?: 'simple' | 'extended';
|
|
114
|
+
/**
|
|
115
|
+
* http query parse options, used when 'simple' mode is used
|
|
116
|
+
*/
|
|
117
|
+
queryParseOptions?: IParseOptions;
|
|
113
118
|
}
|
|
114
119
|
/**
|
|
115
120
|
* @deprecated since version 3.0.0
|
package/dist/logger.js
CHANGED
|
@@ -86,11 +86,9 @@ class MidwayLoggers extends Map {
|
|
|
86
86
|
}
|
|
87
87
|
let loggerConfig = configService.getConfiguration('midwayLogger');
|
|
88
88
|
// 这里属于 hack 了,cluster 模式下会先走这里,找不到默认值
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
loggerConfig = configService.getConfiguration('midwayLogger');
|
|
93
|
-
}
|
|
89
|
+
// 先合并一遍默认配置
|
|
90
|
+
configService.addObject(logger_1.loggers.getDefaultMidwayLoggerConfig(configService.getAppInfo()));
|
|
91
|
+
loggerConfig = configService.getConfiguration('midwayLogger');
|
|
94
92
|
// 这里利用了 loggers 缓存的特性,提前初始化 logger
|
|
95
93
|
if (loggerConfig) {
|
|
96
94
|
for (const id of Object.keys(loggerConfig.clients)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/web",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.3",
|
|
4
4
|
"description": "Midway Web Framework for Egg.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=12"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "a2647ad7e54f489562507798308b41f24333a3ea"
|
|
64
64
|
}
|