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
06980bc0
Commit
06980bc0
authored
Jul 21, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6f2f683b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
5 deletions
+38
-5
forumInfo.js
app/controllers/mobile/forumInfo.js
+4
-2
forumThread.js
app/controllers/mobile/forumThread.js
+34
-3
No files found.
app/controllers/mobile/forumInfo.js
View file @
06980bc0
...
...
@@ -193,7 +193,8 @@ router.get('/info/:fid/hotThreads', function(req, res, next) {
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
level
:
1
,
info
:
fid
info
:
fid
,
status
:{
$ne
:
3
}
};
if
(
fid
)
{
...
...
@@ -247,7 +248,8 @@ router.get('/info/:fid/photoThreads', function(req, res, next) {
ent_code
:
req
.
session
.
user
.
ent_code
,
level
:
1
,
info
:
fid
,
type
:
3
type
:
3
,
status
:{
$ne
:
3
}
};
if
(
fid
)
{
...
...
app/controllers/mobile/forumThread.js
View file @
06980bc0
...
...
@@ -661,6 +661,34 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
}
});
//更改评论状态为3(删除)
router
.
post
(
'/thread/:tid/comment/:cid/disable'
,
function
(
req
,
res
,
next
)
{
var
user_id
=
user
.
getMobileUser
(
req
),
tid
=
req
.
params
.
tid
,
cid
=
req
.
params
.
cid
;
if
(
tid
&&
cid
)
{
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
comment
){
if
(
comment
&&
user_id
){
if
(
comment
.
from
.
toString
()
==
user_id
.
toString
()){
forumCommentService
.
changeStatus
(
cid
,
2
,
function
(
err
,
update
){
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
}
});
}
else
{
res
.
json
(
returnCode
.
ACTION_NOT_PERMISSION
);
}
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
//删除文章评论
router
.
post
(
'/thread/:tid/comment/:cid/delete'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
||
null
;
...
...
@@ -885,7 +913,8 @@ router.get('/thread/:tid/topics', function(req, res, next) {
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
pid
:
tid
,
type
:
2
type
:
2
,
status
:{
$ne
:
3
}
};
if
(
tid
)
{
...
...
@@ -940,6 +969,7 @@ router.get('/thread/:tid/latestPhotos', function(req, res, next) {
ent_code
:
req
.
session
.
user
.
ent_code
,
pid
:
tid
,
type
:
3
,
status
:{
$ne
:
3
},
images
:
{
$exists
:
true
,
$not
:
{
$size
:
0
}}
};
...
...
@@ -994,6 +1024,7 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
ent_code
:
req
.
session
.
user
.
ent_code
,
pid
:
tid
,
type
:
3
,
status
:{
$ne
:
3
},
images
:
{
$exists
:
true
,
$not
:
{
$size
:
0
}}
};
...
...
@@ -1040,13 +1071,13 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
//逻辑删除文章
router
.
post
(
'/thread/:tid/
logicDeleteThread
'
,
function
(
req
,
res
,
next
)
{
router
.
post
(
'/thread/:tid/
disable
'
,
function
(
req
,
res
,
next
)
{
var
user_id
=
user
.
getMobileUser
(
req
);
var
tid
=
req
.
params
.
tid
;
if
(
tid
)
{
forumThreadService
.
getThreadById
(
tid
,
function
(
err
,
thread
){
if
(
thread
.
from
&&
user_id
){
if
(
thread
.
from
.
toString
()
==
user_id
.
toString
()){
if
(
thread
.
from
.
_id
.
toString
()
==
user_id
.
toString
()){
forumThreadService
.
logicDeleteThreadById
(
tid
,
function
(
err
,
flag
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
...
...
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