jpress-perfree-simple icon indicating copy to clipboard operation
jpress-perfree-simple copied to clipboard

当开启评论需管理员审核功能后,在文章详情页面评论成功后不能清晰提示用户的bug

Open ananix opened this issue 5 years ago • 0 comments

如题,当开启评论需管理员审核功能后,在文章详情页面评论成功后;在回调里面并没有考虑这种情况 if(result.user != null){ avatarUrl = result.user.avatar; author = result.comment.author; }else { avatarUrl = "/templates/jpress-perfree-simple/static/img/avatar.png"; author = "匿名用户"; } 在上述代码**author = result.comment.author;**中会报undefined错误; 建议:

  • 优化后台返回,即使还未审核通过,也应该让用户知晓评论成功
  • 修改后台返回comment,并在页面友好展示(如显示为待审核)
  • 修改页面提示告知用户,如在上述代码之前添加: if(result.comment == null){ layer.msg('评论成功,管理员审核后可见。。', {icon: 1}); //清空编辑器 layedit.clearContent(edit); $(".captcha").val(""); $(".comment-verify").attr("src",'/commons/captcha?d='+Math.random()); return; }

ananix avatar Nov 05 '19 07:11 ananix