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
3926e6a1
Commit
3926e6a1
authored
Aug 28, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版 - 评论返回完整评论
parent
39c167aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
forumThread.js
app/controllers/mobile/forumThread.js
+15
-18
No files found.
app/controllers/mobile/forumThread.js
View file @
3926e6a1
...
@@ -447,8 +447,6 @@ router.post('/thread/:tid/share', function(req, res, next) {
...
@@ -447,8 +447,6 @@ router.post('/thread/:tid/share', function(req, res, next) {
//新增文章评论
//新增文章评论
router
.
post
(
'/thread/:tid/comment/add'
,
function
(
req
,
res
,
next
)
{
router
.
post
(
'/thread/:tid/comment/add'
,
function
(
req
,
res
,
next
)
{
var
userId
=
req
.
session
.
mobileForumUser
.
userId
;
var
userId
=
req
.
session
.
mobileForumUser
.
userId
;
console
.
log
(
'!!!!!!!!!!!!!!!!!!!!!!!!!!!'
);
var
data
=
null
;
forumLimitActionRefService
.
checkLimitActionProhibitionOfSpeech
(
userId
,
function
(
err
,
isProhibition
){
forumLimitActionRefService
.
checkLimitActionProhibitionOfSpeech
(
userId
,
function
(
err
,
isProhibition
){
if
(
err
){
if
(
err
){
console
.
error
(
err
);
console
.
error
(
err
);
...
@@ -508,7 +506,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -508,7 +506,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if
(
err
)
{
if
(
err
)
{
callback
(
err
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
data
=
newComment
;
var
comments
=
thread
.
comments
;
var
comments
=
thread
.
comments
;
// console.log('=========');
// console.log('=========');
// console.log(comments);
// console.log(comments);
...
@@ -522,9 +519,9 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -522,9 +519,9 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
comments
:
array
comments
:
array
},
function
(
err
,
result
)
{
},
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
callback
(
err
,
n
ull
);
callback
(
err
,
n
ewComment
);
}
else
{
}
else
{
callback
(
null
,
n
ull
);
callback
(
null
,
n
ewComment
);
}
}
});
});
}
}
...
@@ -561,9 +558,17 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -561,9 +558,17 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
}
}
}
}
});
});
var
rs
=
{};
forumCommentService
.
getPopulateCommentById
(
results
[
0
].
_id
,
function
(
err
,
c
)
{
rs
.
data
=
data
;
if
(
err
)
{
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
res
.
json
(
returnCode
.
BUSY
);
}
else
{
console
.
log
(
c
);
var
rs
=
{};
rs
.
data
=
c
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
});
}
}
});
});
...
@@ -845,23 +850,16 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
...
@@ -845,23 +850,16 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
}
}
}
}
});
});
forumCommentService
.
getPopulateCommentById
(
results
[
0
].
_id
,
function
(
err
,
c
)
{
// httpService.sendRequest(req.session.user.ent_code, req.session.openUser.mid, 'reply');
ForumComment
.
populate
(
results
[
0
],
{
path
:
'from to'
,
select
:
'uid nickName icon comments'
},
function
(
err
,
c
)
{
if
(
err
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
var
rs
=
{};
var
rs
=
{};
rs
.
data
=
results
[
0
]
;
rs
.
data
=
c
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
}
});
});
// res.json(returnCode.SUCCESS);
}
}
});
});
}
}
...
@@ -881,7 +879,6 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
...
@@ -881,7 +879,6 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
}
}
});
});
});
});
//更改评论状态为3(删除)
//更改评论状态为3(删除)
router
.
post
(
'/thread/:tid/comment/:cid/disable'
,
function
(
req
,
res
,
next
)
{
router
.
post
(
'/thread/:tid/comment/:cid/disable'
,
function
(
req
,
res
,
next
)
{
var
user_id
=
user
.
getMobileUser
(
req
),
var
user_id
=
user
.
getMobileUser
(
req
),
...
...
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