From c3e758ab4f96a0187a022c49c18e548148e56da4 Mon Sep 17 00:00:00 2001 From: Minho Date: Thu, 22 Feb 2018 17:21:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/document.go | 4 ++-- views/book/index.tpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/document.go b/controllers/document.go index d2e27351..08988a1c 100644 --- a/controllers/document.go +++ b/controllers/document.go @@ -340,8 +340,8 @@ func (c *DocumentController) Create() { } if doc_identify != "" { - if ok, err := regexp.MatchString(`^[a-z]+[a-zA-Z0-9_\-]*$`, doc_identify); !ok || err != nil { - c.JsonResult(6003, "文档标识只能包含小写字母、数字,以及“-”和“_”符号,并且只能小写字母开头") + if ok, err := regexp.MatchString(`[a-z]+[a-zA-Z0-9_.\-]*$`, doc_identify); !ok || err != nil { + c.JsonResult(6003, "文档标识只能包含小写字母、数字,以及“-”、“.”和“_”符号") } d, _ := models.NewDocument().FindByFieldFirst("identify", doc_identify) diff --git a/views/book/index.tpl b/views/book/index.tpl index df41ad83..0e679f6e 100644 --- a/views/book/index.tpl +++ b/views/book/index.tpl @@ -141,7 +141,7 @@
-

文档标识只能包含小写字母、数字,以及“-”和“_”符号,并且只能小写字母开头

+

文档标识只能包含小写字母、数字,以及“-”、“.”和“_”符号.