数据库配置中支持特殊字符

This commit is contained in:
GoEdgeLab
2020-11-24 09:50:22 +08:00
parent 688c5742bc
commit 8e97b5f512
3 changed files with 17 additions and 19 deletions

View File

@@ -109,12 +109,6 @@ func (this *UpdateAction) RunPost(params struct {
Require("请输入连接数据库的用户名").
Match(`^[\w\.-]+$`, "用户名中不能包含特殊字符")
if len(params.Password) > 0 {
params.Must.
Field("password", params.Password).
Match(`^[\w\.-]+$`, "密码中不能包含特殊字符")
}
// 保存
dsn := params.Username + ":" + params.Password + "@tcp(" + params.Host + ":" + fmt.Sprintf("%d", params.Port) + ")/" + params.Database