skybase 0.1.100 → 0.1.104
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/CHANGELOG.md +1 -16
- package/lib/middleware/sky-check-param.js +18 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
## [0.1.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## [0.1.98](https://github.com/kongnet/skybase/compare/v0.1.97...v0.1.98) (2025-10-14)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## [0.1.97](https://github.com/kongnet/skybase/compare/v0.1.96...v0.1.97) (2025-10-14)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## [0.1.96](https://github.com/kongnet/skybase/compare/v0.1.95...v0.1.96) (2025-10-14)
|
|
1
|
+
## [0.1.100](https://github.com/kongnet/skybase/compare/v0.1.95...v0.1.100) (2025-12-13)
|
|
17
2
|
|
|
18
3
|
|
|
19
4
|
### :sparkles:
|
|
@@ -140,7 +140,24 @@ module.exports = async (ctx, next) => {
|
|
|
140
140
|
)
|
|
141
141
|
apiCheckLog(apiPath, ctx.checkedData, method, params, ctx)
|
|
142
142
|
if (ctx.checkedData.code >= 400) {
|
|
143
|
-
|
|
143
|
+
/* 有errSimple 看是否配置了语言参数_lang=en 或者 默认default,或者直接返回errSimple.
|
|
144
|
+
没有 errSimple 返回 ctx.checkedData.msg
|
|
145
|
+
errSimple: {
|
|
146
|
+
default: 'Parameter error, please check the input parameters',
|
|
147
|
+
zh: '参数错误,请检查输入参数'
|
|
148
|
+
},
|
|
149
|
+
或者
|
|
150
|
+
errSimple:'err msg'
|
|
151
|
+
*/
|
|
152
|
+
return ctx.throwCode(
|
|
153
|
+
400,
|
|
154
|
+
apiSetting.errSimple
|
|
155
|
+
? apiSetting.errSimple[params['_lang'] ? params['_lang'] : 'default'] ||
|
|
156
|
+
(typeof apiSetting.errSimple === 'string'
|
|
157
|
+
? apiSetting.errSimple
|
|
158
|
+
: ctx.checkedData.msg)
|
|
159
|
+
: ctx.checkedData.msg
|
|
160
|
+
)
|
|
144
161
|
}
|
|
145
162
|
await next()
|
|
146
163
|
}
|