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
ea22a43b
Commit
ea22a43b
authored
Sep 08, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除打印
parent
37a1a073
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
11 deletions
+1
-11
forumInfo.js
app/controllers/mobile/forumInfo.js
+1
-3
forumThread.js
app/controllers/mobile/forumThread.js
+0
-8
No files found.
app/controllers/mobile/forumInfo.js
View file @
ea22a43b
...
@@ -454,7 +454,7 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
...
@@ -454,7 +454,7 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
}
}
forumCommentService
.
getAllCommentByThread
(
conditions
,
function
(
err
,
results
)
{
forumCommentService
.
getAllCommentByThread
(
conditions
,
function
(
err
,
results
)
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
var
docs
=
[];
var
docs
=
[];
...
@@ -465,7 +465,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
...
@@ -465,7 +465,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
if
(
doc
.
comments
&&
doc
.
comments
.
length
>
0
){
//有子评论
if
(
doc
.
comments
&&
doc
.
comments
.
length
>
0
){
//有子评论
var
comments
=
[];
var
comments
=
[];
doc
.
comments
.
forEach
(
function
(
comment
,
j
){
doc
.
comments
.
forEach
(
function
(
comment
,
j
){
console
.
log
((
comment
.
from
&&
comment
.
from
.
_id
==
id
),(
comment
.
to
&&
comment
.
to
.
_id
==
id
),
id
);
if
((
comment
.
from
&&
comment
.
from
.
_id
==
id
)
||
(
comment
.
to
&&
comment
.
to
.
_id
==
id
)){
if
((
comment
.
from
&&
comment
.
from
.
_id
==
id
)
||
(
comment
.
to
&&
comment
.
to
.
_id
==
id
)){
//二级评论的作者 或 被评论者是自己
//二级评论的作者 或 被评论者是自己
comments
.
push
(
comment
);
comments
.
push
(
comment
);
...
@@ -486,7 +485,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
...
@@ -486,7 +485,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
obj
.
pageNo
=
pageNo
;
obj
.
pageNo
=
pageNo
;
obj
.
pageSize
=
pageSize
;
obj
.
pageSize
=
pageSize
;
obj
.
items
=
docs
.
slice
((
pageNo
-
1
>=
0
?
pageNo
-
1
:
0
)
*
pageSize
,
pageSize
);
obj
.
items
=
docs
.
slice
((
pageNo
-
1
>=
0
?
pageNo
-
1
:
0
)
*
pageSize
,
pageSize
);
console
.
log
(
obj
.
items
);
res
.
json
(
_
.
assign
(
obj
,
returnCode
.
SUCCESS
));
res
.
json
(
_
.
assign
(
obj
,
returnCode
.
SUCCESS
));
}
}
});
});
...
...
app/controllers/mobile/forumThread.js
View file @
ea22a43b
...
@@ -520,7 +520,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -520,7 +520,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if
(
content
)
{
//评论不能为空
if
(
content
)
{
//评论不能为空
//2.获取论坛文章
//2.获取论坛文章
forumThreadService
.
getThreadById
(
tid
,
function
(
err
,
thread
)
{
forumThreadService
.
getThreadById
(
tid
,
function
(
err
,
thread
)
{
console
.
log
(
err
);
if
(
err
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
...
@@ -543,7 +542,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -543,7 +542,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
};
};
forumCommentService
.
count
(
conditions
,
function
(
err
,
count
)
{
forumCommentService
.
count
(
conditions
,
function
(
err
,
count
)
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
callback
(
err
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
// callback(null, count);
// callback(null, count);
...
@@ -560,9 +558,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -560,9 +558,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
forumThreadAttendService
.
threadAttend
(
thread
.
_id
,
user
.
getMobileUser
(
req
),
function
(
err
){});
forumThreadAttendService
.
threadAttend
(
thread
.
_id
,
user
.
getMobileUser
(
req
),
function
(
err
){});
}
}
var
comments
=
thread
.
comments
;
var
comments
=
thread
.
comments
;
// console.log('=========');
// console.log(comments);
// console.log('=========');
var
array
=
[];
var
array
=
[];
if
(
comments
&&
comments
.
items
&&
comments
.
items
.
length
>
0
)
{
if
(
comments
&&
comments
.
items
&&
comments
.
items
.
length
>
0
)
{
array
=
comments
.
items
;
array
=
comments
.
items
;
...
@@ -587,7 +582,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -587,7 +582,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if
(
thread
)
{
if
(
thread
)
{
forumThreadService
.
updateThreadCommentCountInc
(
tid
,
function
(
err
,
results
)
{
forumThreadService
.
updateThreadCommentCountInc
(
tid
,
function
(
err
,
results
)
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
callback
(
err
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
callback
(
null
,
null
);
callback
(
null
,
null
);
...
@@ -615,8 +609,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
...
@@ -615,8 +609,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if
(
err
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
console
.
log
(
c
);
var
rs
=
{};
var
rs
=
{};
rs
.
data
=
c
;
rs
.
data
=
c
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
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