优化项目标识

pull/219/merge
Minho 2018-02-22 17:21:43 +08:00
parent 088b3ec075
commit c3e758ab4f
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -141,7 +141,7 @@
</div>
<input type="text" class="form-control pull-left" style="width: 410px;vertical-align: middle" placeholder="项目唯一标识(不超过50字)" name="identify" id="identify">
<div class="clearfix"></div>
<p class="text" style="font-size: 12px;color: #999;margin-top: 6px;">文档标识只能包含小写字母、数字,以及“-”和“_”符号,并且只能小写字母开头</p>
<p class="text" style="font-size: 12px;color: #999;margin-top: 6px;">文档标识只能包含小写字母、数字,以及“-”、“.”和“_”符号.</p>
</div>
<div class="form-group">
<textarea name="description" id="description" class="form-control" placeholder="描述信息不超过500个字符" style="height: 90px;"></textarea>