diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 28bf73a..cba125e 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -152,7 +152,9 @@ class Article extends BaseController //获取评论 $data = Request::only(['content','article_id','user_id']); $sendId = $data['user_id']; - + if(empty($data['content'])){ + return json(['code'=>0, 'msg'=>'评论不能为空!']); + } //用户留言存入数据库 if (Comment::create($data)) { //站内信 @@ -184,7 +186,6 @@ class Article extends BaseController { if(Request::isAjax()){ $data = Request::only(['cate_id','title','title_color','user_id','content','upzip','tags','captcha']); - halt($data); $validate = new \app\common\validate\Article; //调用验证器 $result = $validate->scene('Artadd')->check($data); //进行数据验证 if(true !==$result){