From fbc811ad76f2650a0264bd141108e1f6e1ae65c1 Mon Sep 17 00:00:00 2001 From: Zeno-Code Date: Wed, 14 Mar 2018 01:31:45 +0800 Subject: [PATCH] Update Former-commit-id: 1dec0ab6da6e6d6ce9c11d36dafdf1d2f0aca798 --- HISTORY_ZH.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/HISTORY_ZH.md b/HISTORY_ZH.md index 781606a1..36d39da9 100644 --- a/HISTORY_ZH.md +++ b/HISTORY_ZH.md @@ -17,9 +17,41 @@ **如何升级**: 打开命令行执行以下命令: `go get -u github.com/kataras/iris` 或者等待自动更新。 -# Sa, 10 March 2018 | v10.3.0 +# 2018 3月10号 | v10.3.0 版本更新 -This history entry is not translated yet to the Chinese language yet, please refer to the original [HISTORY entry](https://github.com/kataras/iris/blob/master/HISTORY.md#sa-10-march-2018--v1030) instead. +- 只有一项 API 更改 [Application/Context/Router#RouteExists](https://godoc.org/github.com/kataras/iris/core/router#Router.RouteExists), 将 `Context` 作为第一参数,而不是最后一个。 + +- 修正 cors 中间件 https://github.com/iris-contrib/middleware/commit/048e2be034ed172c6754448b8a54a9c55debad46, 相关问题: https://github.com/kataras/iris/issues/922 (目前仍在等待验证). + +- 添加 `Context#NextOr` 和 `Context#NextOrNotFound` 方法 + +```go +// NextOr 检查程序链上是否有下一个处理程序,如果是,则执行它 +// 否则根据给定的处理程序设置分配给 Context 程序链,并且执行第一个控制器。 +// +// 如果下一个处理器存在并执行,则返回true,否则返回false +// +// 请注意,如果没有找到下一个处理程序并且处理程序缺失, +// 会发送 (404) 状态码到客户端,并停止执行。 +NextOr(handlers ...Handler) bool +// NextOrNotFound 检查程序链上是否存在下一个处理程序,如果有则执行 +// 其他情况会发送 404 状态码,并停止执行。 +// +// 如果下一个控制器存在并执行,返回 true , 其他情况 false. +NextOrNotFound() bool +``` + +- 新增方法 `Party#AllowMethods` 如果在 `Handle, Get, Post...` 之前调用,则会将路由克隆到该方法. + +- 修复 POST 请求尾部斜杠重定向问题: https://github.com/kataras/iris/issues/921 https://github.com/kataras/iris/commit/dc589d9135295b4d080a9a91e942aacbfe5d56c5 + +- 新增示例 通过 `iris#UnmarshalerFunc` 自定义解码, 新增 `context#ReadXML` 使用示例, [相关示例](https://github.com/kataras/iris/tree/master/_examples#how-to-read-from-contextrequest-httprequest)via https://github.com/kataras/iris/commit/78cd8e5f677fe3ff2c863c5bea7d1c161bf4c31e. + +- 新增自定义路由宏功能示例, 相关讨论 https://github.com/kataras/iris/issues/918, [示例代码](https://github.com/kataras/iris/blob/master/_examples/routing/dynamic-path/main.go#L144-L158), https://github.com/kataras/iris/commit/a7690c71927cbf3aa876592fab94f04cada91b72 + +- 为 `Pongo` 新增 `AsValue()` 和 `AsSaveValue()` @neenar https://github.com/kataras/iris/pull/913 + +- 删除 `context#UnmarshalBody` 上不必要的反射 https://github.com/kataras/iris/commit/4b9e41458b62035ea4933789c0a132c3ef2a90cc # 2018 2月15号 | v10.2.1 版本更新