mirror of https://github.com/mindoc-org/mindoc.git
优化项目标识
parent
088b3ec075
commit
c3e758ab4f
|
@ -340,8 +340,8 @@ func (c *DocumentController) Create() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if doc_identify != "" {
|
if doc_identify != "" {
|
||||||
if ok, err := regexp.MatchString(`^[a-z]+[a-zA-Z0-9_\-]*$`, doc_identify); !ok || err != nil {
|
if ok, err := regexp.MatchString(`[a-z]+[a-zA-Z0-9_.\-]*$`, doc_identify); !ok || err != nil {
|
||||||
c.JsonResult(6003, "文档标识只能包含小写字母、数字,以及“-”和“_”符号,并且只能小写字母开头")
|
c.JsonResult(6003, "文档标识只能包含小写字母、数字,以及“-”、“.”和“_”符号")
|
||||||
}
|
}
|
||||||
|
|
||||||
d, _ := models.NewDocument().FindByFieldFirst("identify", doc_identify)
|
d, _ := models.NewDocument().FindByFieldFirst("identify", doc_identify)
|
||||||
|
|
|
@ -141,7 +141,7 @@
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control pull-left" style="width: 410px;vertical-align: middle" placeholder="项目唯一标识(不超过50字)" name="identify" id="identify">
|
<input type="text" class="form-control pull-left" style="width: 410px;vertical-align: middle" placeholder="项目唯一标识(不超过50字)" name="identify" id="identify">
|
||||||
<div class="clearfix"></div>
|
<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>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea name="description" id="description" class="form-control" placeholder="描述信息不超过500个字符" style="height: 90px;"></textarea>
|
<textarea name="description" id="description" class="form-control" placeholder="描述信息不超过500个字符" style="height: 90px;"></textarea>
|
||||||
|
|
Loading…
Reference in New Issue