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
16d2dc7c
Commit
16d2dc7c
authored
Aug 27, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d062633c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
forumThread.js
app/controllers/mobile/forumThread.js
+16
-11
No files found.
app/controllers/mobile/forumThread.js
View file @
16d2dc7c
...
@@ -616,31 +616,36 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
...
@@ -616,31 +616,36 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
});
});
//新增文章评论
//新增文章评论
router
.
post
(
'/thread/:tid/comment/create/new'
,
function
(
req
,
res
,
next
)
{
router
.
post
(
'/thread/:tid/comment/create/new'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
'------------------in------------------'
);
var
userId
=
req
.
session
.
mobileForumUser
.
userId
;
var
userId
=
req
.
session
.
mobileForumUser
.
userId
;
forumLimitActionRefService
.
checkLimitActionProhibitionOfSpeech
(
userId
,
function
(
err
,
isProhibition
){
forumLimitActionRefService
.
checkLimitActionProhibitionOfSpeech
(
userId
,
function
(
err
,
isProhibition
){
console
.
log
(
'1'
);
if
(
err
){
if
(
err
){
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
PROHIBITION_OF_SPEECH
);
res
.
json
(
returnCode
.
PROHIBITION_OF_SPEECH
);
}
else
{
}
else
{
console
.
log
(
'2'
);
if
(
isProhibition
){
if
(
isProhibition
){
res
.
json
(
returnCode
.
PROHIBITION_OF_SPEECH
);
res
.
json
(
returnCode
.
PROHIBITION_OF_SPEECH
);
}
else
{
}
else
{
console
.
log
(
'3'
);
var
tid
=
req
.
params
.
tid
||
null
;
var
tid
=
req
.
params
.
tid
||
null
;
if
(
tid
)
{
if
(
tid
)
{
var
integral
=
req
.
session
.
openUser
.
integral
||
0
;
var
integral
=
req
.
session
.
openUser
.
integral
||
0
;
var
exp
=
req
.
session
.
openUser
.
exp
||
0
;
var
exp
=
req
.
session
.
openUser
.
exp
||
0
;
var
destination
=
req
.
body
.
destination
||
'1'
;
var
destination
=
req
.
body
.
destination
||
'1'
;
//1.检查是否有权限
//1.检查是否有权限
forumRolePermissionService
.
checkRolePermiss
(
req
.
session
.
user
.
ent_code
,
'comment'
,
integral
,
exp
,
function
(
err
,
result
)
{
//
forumRolePermissionService.checkRolePermiss(req.session.user.ent_code, 'comment', integral, exp, function(err, result) {
if
(
err
)
{
//
if (err) {
console
.
error
(
err
);
//
console.error(err);
res
.
json
(
returnCode
.
BUSY
);
//
res.json(returnCode.BUSY);
}
else
{
//
} else {
if
(
result
)
{
//有操作权限
//
if (result) { //有操作权限
var
content
=
req
.
body
.
content
;
var
content
=
req
.
body
.
content
;
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
{
...
@@ -772,11 +777,11 @@ router.post('/thread/:tid/comment/create/new', function(req, res, next) {
...
@@ -772,11 +777,11 @@ router.post('/thread/:tid/comment/create/new', function(req, res, next) {
}
else
{
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
}
}
else
{
//
} else {
res
.
json
(
returnCode
.
ACTION_NOT_PERMISSION
);
//
res.json(returnCode.ACTION_NOT_PERMISSION);
}
//
}
}
//
}
});
//
});
}
else
{
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
}
...
...
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