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
1bc91e62
Commit
1bc91e62
authored
Apr 21, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加、更新评论
parent
b33fa754
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
forumThread.js
app/controllers/admin/forumThread.js
+16
-1
No files found.
app/controllers/admin/forumThread.js
View file @
1bc91e62
...
...
@@ -121,12 +121,17 @@ router.get('/thread/:tid/get', function(req, res, next) {
//更新文章状态、如:屏蔽
router
.
post
(
'/thread/:tid/update'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
;
var
fatherTitle
=
req
.
body
.
father
;
delete
req
.
body
.
father
;
req
.
body
.
ent_code
=
req
.
session
.
user
.
ent_code
;
if
(
tid
){
forumThreadService
.
updateThreadById
(
tid
,
req
.
body
,
function
(
err
,
thread
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
console
.
log
(
thread
);
console
.
log
(
fatherTitle
);
res
.
json
({
message
:
"success"
,
data
:
thread
,
title
:
fatherTitle
});
}
});
}
else
{
...
...
@@ -134,6 +139,7 @@ router.post('/thread/:tid/update', function(req, res, next) {
}
});
//删除文章
router
.
post
(
'/thread/:tid/delete'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
;
...
...
@@ -196,6 +202,7 @@ router.get('/threads/list', function(req, res, next) {
var
pageSize
=
req
.
query
.
pageSize
||
10
;
var
infoId
=
req
.
query
.
infoId
;
var
tagId
=
req
.
query
.
tagId
;
var
pid
=
req
.
query
.
pid
;
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
level
:
1
...
...
@@ -206,6 +213,13 @@ router.get('/threads/list', function(req, res, next) {
if
(
tagId
){
conditions
.
tag
=
{
$in
:[
tagId
]};
}
if
(
pid
){
conditions
.
pid
=
pid
;
conditions
.
level
=
2
;
}
console
.
log
(
conditions
);
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
null
,
function
(
err
,
results
){
if
(
err
){
console
.
error
(
err
);
...
...
@@ -216,6 +230,7 @@ router.get('/threads/list', function(req, res, next) {
});
});
//评论列表
router
.
get
(
'/thread/:tid/comment/list'
,
function
(
req
,
res
,
next
)
{
...
...
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