2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-05 12:23:35 +08:00

feat: 添加网站前确保记录不存在

This commit is contained in:
耗子
2023-08-27 11:48:38 +08:00
parent c32ae4a733
commit 427f7dc230

View File

@@ -52,7 +52,7 @@ func (c *WebsiteController) Add(ctx http.Context) {
return
}
validator, err := ctx.Request().Validate(map[string]string{
"name": "required|regex:^[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*$",
"name": "required|regex:^[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*$|not_exists:websites,name",
"domain": "required",
"php": "required",
"db": "bool",