From 329b24d90d8b90a8941f354d552b96e9c94d6d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 17 Jul 2019 19:20:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/libraries/_form.html.erb | 11 +++++++++++ public/react/src/modules/tpm/SiderBar.js | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index c67a8b57..9904f602 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -145,10 +145,21 @@ if (!title || title.length == 0) { $("#title_notice").removeClass("none"); + $("#title_notice").html("请输入标题"); return }else{ $("#title_notice").addClass("none"); } + + if (!title || title.length >10) { + $("#title_notice").removeClass("none"); + $("#title_notice").html("字数不能超过10个字"); + return + }else{ + $("#title_notice").addClass("none"); + } + + if (!content || content.length == 0) { $("#des_notice").removeClass("none"); return diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index a2172e48..fd74c759 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -53,7 +53,7 @@ class SiderBar extends Component {
- +