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
46020da7
Commit
46020da7
authored
Mar 23, 2016
by
strong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remould_0308_forum'
parents
4c9665f7
6125c659
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
forumThread.js
app/controllers/mobile/forumThread.js
+13
-1
forumCommentService.js
app/service/forumCommentService.js
+1
-1
No files found.
app/controllers/mobile/forumThread.js
View file @
46020da7
...
...
@@ -3,6 +3,7 @@ var express = require('express'),
router
=
express
.
Router
(),
returnCode
=
require
(
'../../utils/returnCode'
),
util
=
require
(
'../../utils/util'
),
loadUserLevel
=
require
(
'../../utils/loadUserLevel'
),
_
=
require
(
'lodash'
);
var
mongoose
=
require
(
'mongoose'
);
var
ForumThread
=
mongoose
.
model
(
'ForumThread'
);
...
...
@@ -885,7 +886,16 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
}
else
{
var
rs
=
{};
rs
.
data
=
c
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
loadUserLevel
.
loadLevelFromAPI
(
req
.
session
.
user
.
ent_code
,
rs
.
data
.
from
.
uid
,
function
(
err
,
expValue
){
if
(
!
err
){
rs
.
data
=
rs
.
data
.
toObject
();
if
(
!
expValue
)
rs
.
data
.
from
.
exp
=
0
;
else
rs
.
data
.
from
.
exp
=
expValue
[
rs
.
data
.
from
.
uid
];
}
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
});
}
});
...
...
@@ -1247,6 +1257,8 @@ router.post('/thread/:tid/comment/:cid/slash', function(req, res, next) {
q1
.
status
=
1
;
q1
.
$or
=
[{
recommend
:
0
},{
recommend
:
1
},
{
recommend
:
null
}];
...
...
app/service/forumCommentService.js
View file @
46020da7
...
...
@@ -461,7 +461,7 @@ exports.getPopulateCommentById = function(cid, callback) {
_id
:
cid
}).
populate
({
path
:
'from to'
,
select
:
'uid nickName icon'
select
:
'uid nickName icon
honorTitles
'
}).
exec
(
function
(
err
,
c
)
{
if
(
err
)
{
console
.
error
(
err
);
...
...
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