Commit 0852c32b authored by 陈家荣's avatar 陈家荣

帖子发布前校验用户输入内容是否全部为表情

parent 4a880a22
...@@ -58,7 +58,14 @@ function create(req, callback) { ...@@ -58,7 +58,14 @@ function create(req, callback) {
entity.images = array; entity.images = array;
} }
//-----------处理前端上传图片结束 //-----------处理前端上传图片结束
if (entity.pid && entity.type == 3) {
//校验是否全是表情
var temp_content = entity.content;
temp_content = temp_content.replace(/<img\/?.+?border="0">/g,"");
if(!temp_content || temp_content.length < 1){
callback('content error', null);
} else if (entity.pid && entity.type == 3) {
forumThreadService.getByConditions({ forumThreadService.getByConditions({
type: 3, type: 3,
level: '2', level: '2',
...@@ -185,7 +192,7 @@ router.post('/thread/create', function(req, res, next) { ...@@ -185,7 +192,7 @@ router.post('/thread/create', function(req, res, next) {
create(req, function(err, thread) { create(req, function(err, thread) {
if (err) { if (err) {
console.error(err); console.error(err);
res.json(returnCode.BUSY); res.json(_.assign(err, returnCode.BUSY));
} else { } else {
forumAboutMEService.saveThread(thread); forumAboutMEService.saveThread(thread);
forumLimitOperationService.checkLimitOperationProhibitionAddIntegral(userId, function(err, flag) { forumLimitOperationService.checkLimitOperationProhibitionAddIntegral(userId, function(err, flag) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment