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 @@
-

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

+

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