---
title: "v1.2 2018-11-26"
url: "https://goframe.org/release/v1.2.0"
markdown_url: "https://goframe.org/release/v1.2.0.md"
locale: "zh-Hans"
version: "2.10.x(Latest)"
section: "版本发布记录"
category: "版本发布记录 / 历史版本记录 v1.x"
published: "2024-11-04"
updated: "2024-11-18"
description: "GoFrame框架v1.2版本的新特性、新功能以及功能改进。此版本增加了对SQLServer和Oracle数据库的支持，完善了gvalid模块的顺序特性，改进了ghttp.Request的处理机制。模板引擎新增多种内置函数，并在gvar、gform、gfsnotify等模块中进行了多项升级和优化。"
keywords: ["GoFrame框架", "SQLServer支持", "Oracle支持", "gvalid校验", "ghttp改进", "模板引擎函数", "gconv改进", "gform配置", "gfsnotify", "WebSocket跨域"]
---

# v1.2 2018-11-26

### 新特性

1. `ORM` 新增对 `SQLServer` 及 `Oracle` 的支持( [https://goframe.org/database/orm/database](https://wiki.goframe.org/database/orm/database))；
2. 完成 `gvalid` 模块校验结果的顺序特性( [https://goframe.org/util/gvalid/checkmap](https://wiki.goframe.org/util/gvalid/checkmap));
3. 改进 `ghttp.Request.Exit`，使得调用该方法时立即退出业务执行，开发者无需调用 `Exit` 方法时再使用 `return` 返回( [https://goframe.org/net/ghttp/service/object](https://wiki.goframe.org/net/ghttp/service/object))；
4. 模板引擎新增若干内置函数: `text/html/htmldecode/url/urldecode/date/compare/substr/strlimit/hidestr/highlight/toupper/tolower/nl2br` ( [https://goframe.org/os/gview/funcs](https://wiki.goframe.org/os/gview/funcs));
5. 模板引擎新增内置变量 `Config` ( [https://goframe.org/os/gview/vars](https://wiki.goframe.org/os/gview/vars));
6. 改进 `gconv.Struct` 转换默认规则，支持不区分大小写的键名与属性名称匹配；
7. `gform` 配置文件支持 `linkinfo` 自定义数据库连接字段( [https://goframe.org/database/orm/config](https://wiki.goframe.org/database/orm/config))；
8. `gfsnotify` 模块增加对特定回调的取消注册功能（ [https://goframe.org/os/gfsnotify/index](https://wiki.goframe.org/os/gfsnotify/index)）；

### 新功能

1. 改进 `ghttp.Request`，增加 `SetParam/GetParam` 请求流程自定义变量设置/获取方法，用于在请求流程中的回调函数共享变量（ [https://goframe.org/net/ghttp/request](https://wiki.goframe.org/net/ghttp/request)）;
2. 改进 `ghttp.Response`，增加 `ServeFileDownload` 方法，用于WebServer引导客户端下载文件( [https://goframe.org/net/ghttp/response](https://wiki.goframe.org/net/ghttp/response));
3. `gvar` 模块新增 `gvar.VarRead` 只读接口，用于控制对外只暴露数据读取功能；
4. 增加 `g.Throw` 抛异常方法， `g.TryCatch` 异常捕获方法封装;
5. 改进 `gcron` 模块，增加自定义的Cron管理对象，增加 `New/Start/Stop` 方法;

### 功能改进

1. WebServer添加 `RouterCacheExpire` 配置参数，用于设置路由检索缓存过期时间；
2. WebServer允许同一 `HOOK` 事件被多次绑定注册，先注册的回调函数优先级更高( [https://goframe.org/net/ghttp/service/hook](https://wiki.goframe.org/net/ghttp/service/hook));
3. 当前工作目录为系统临时目录时， `gcfg`/ `gview`/ `ghttp` 模块默认不添加工作目录到搜索路径;
4. 改进 `WebSocket` 默认支持跨域请求( [https://goframe.org/net/ghttp/websocket](https://wiki.goframe.org/net/ghttp/websocket));
5. 改进 `gtime.Format` 支持中文;
6. 改进 `gfsnotify`，支持编辑器对文件非执行标准编辑时(RENAME+CHMOD)的热更新问题;
7. 改进 `gtype.Set` 方法，增加Set原子操作返回旧的变量值;
8. `gfile.ScanDir` 增加支持 `pattern` 多个文件模式匹配，使用’ `,`‘符号分隔多个匹配模式;
9. `gcfg` 模块增加获取配置变量为 `*gvar.Var`;
10. `gstr` 模块增加对中文截取方法;
11. 改进 `gtime.StrToTime` 对常用时间格式匹配模式，新增 `gtime.ParseTimeFromContent` 方法;
12. 修改配置管理、模板引擎、调试模式的环境变量名称为大写下划线标准格式;
13. 改进 `grand` 模块随机数生成设计，底层使用 `crypto/rand` +缓冲区实现高速的随机数生成( [https://goframe.org/util/grand/index](https://wiki.goframe.org/util/grand/index));

### 问题修复

1. 修复 `gspath` 模块在 `windows` 下搜索失效问题；
2. 修复 `gspath` 模块Search时带有indexFiles的检索问题;
3. bug fix INZS1( [https://github.com/gogf/gf/issues/INZS1](https://github.com/gogf/gf/issues/INZS1));
4. 修复 `gproc.ShellRun` 在windows下的执行问题;
