Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
bc504856
Commit
bc504856
authored
Aug 27, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f4858ecf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
41 deletions
+5
-41
forumThread.js
app/controllers/mobile/forumThread.js
+5
-41
No files found.
app/controllers/mobile/forumThread.js
View file @
bc504856
...
...
@@ -616,19 +616,16 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
});
//新增文章评论
router
.
post
(
'/thread/:tid/comment/createv2'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
'------------------in------------------'
);
var
userId
=
req
.
session
.
mobileForumUser
.
userId
;
var
data
=
null
;
forumLimitActionRefService
.
checkLimitActionProhibitionOfSpeech
(
userId
,
function
(
err
,
isProhibition
){
console
.
log
(
'1'
);
if
(
err
){
console
.
error
(
err
);
res
.
json
(
returnCode
.
PROHIBITION_OF_SPEECH
);
}
else
{
console
.
log
(
'2'
);
if
(
isProhibition
){
res
.
json
(
returnCode
.
PROHIBITION_OF_SPEECH
);
}
else
{
console
.
log
(
'3'
);
var
tid
=
req
.
params
.
tid
||
null
;
if
(
tid
)
{
var
integral
=
req
.
session
.
openUser
.
integral
||
0
;
...
...
@@ -680,6 +677,7 @@ router.post('/thread/:tid/comment/createv2', function(req, res, next) {
if
(
err
)
{
callback
(
err
,
null
);
}
else
{
data
=
newComment
;
var
comments
=
thread
.
comments
;
// console.log('=========');
// console.log(comments);
...
...
@@ -732,43 +730,9 @@ router.post('/thread/:tid/comment/createv2', function(req, res, next) {
}
}
});
async
.
parallel
([
function
(
callback
)
{
//获取最新5条评论
var
conditions
=
{
thread
:
tid
,
level
:
'1'
};
forumCommentService
.
getAllComment
(
conditions
,
1
,
5
,
function
(
err
,
results
)
{
if
(
err
)
{
console
.
log
(
err
);
callback
(
err
,
null
);
}
else
{
callback
(
null
,
results
);
}
});
},
function
(
callback
)
{
forumThreadService
.
getThreadById
(
tid
,
function
(
err
,
thread
)
{
if
(
err
)
{
console
.
log
(
err
);
callback
(
err
,
null
);
}
else
{
callback
(
null
,
thread
);
}
});
}
],
function
(
err
,
results
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
}
else
{
var
rs
=
{};
rs
.
comments
=
results
[
0
].
items
;
rs
.
commentCount
=
results
[
1
].
comment_count
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
});
var
rs
=
{};
rs
.
data
=
data
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment