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
289fb8af
Commit
289fb8af
authored
Aug 09, 2016
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台修改前端发布帖子限制更新内容
parent
87b7cf4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
forumThread.js
app/controllers/admin/forumThread.js
+34
-11
No files found.
app/controllers/admin/forumThread.js
View file @
289fb8af
...
@@ -269,20 +269,43 @@ router.post('/thread/:tid/update', function(req, res, next) {
...
@@ -269,20 +269,43 @@ router.post('/thread/:tid/update', function(req, res, next) {
delete
req
.
body
.
father
;
delete
req
.
body
.
father
;
req
.
body
.
ent_code
=
req
.
session
.
user
.
ent_code
;
req
.
body
.
ent_code
=
req
.
session
.
user
.
ent_code
;
if
(
tid
)
{
if
(
tid
)
{
forumThreadService
.
updateThreadById
(
tid
,
req
.
body
,
function
(
err
,
thread
)
{
forumThreadService
.
getById
(
tid
,
function
(
err
,
doc
){
if
(
err
)
{
if
(
err
||
!
doc
){
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
else
{
}
if
(
!
isNaN
(
req
.
body
.
status
))
{
//如果修改的帖子为手机端发布的,则限制更新信息
forumAboutMEService
.
updateThreadStatus
(
thread
.
_id
,
thread
.
status
)
if
(
doc
.
isPublishByBg
==
0
){
var
body
=
req
.
body
;
req
.
body
=
{};
if
(
body
.
status
!=
null
){
req
.
body
.
status
=
body
.
status
;
}
if
(
body
.
isEvent
!=
null
){
req
.
body
.
isEvent
=
body
.
isEvent
;
if
(
body
.
event
!=
null
){
req
.
body
.
event
=
body
.
event
;
}
}
if
(
body
.
tag
!=
null
){
req
.
body
.
tag
=
body
.
tag
;
}
}
res
.
json
({
message
:
"success"
,
data
:
thread
,
title
:
fatherTitle
});
}
}
forumThreadService
.
updateThreadById
(
tid
,
req
.
body
,
function
(
err
,
thread
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
}
else
{
if
(
!
isNaN
(
req
.
body
.
status
))
{
forumAboutMEService
.
updateThreadStatus
(
thread
.
_id
,
thread
.
status
)
}
res
.
json
({
message
:
"success"
,
data
:
thread
,
title
:
fatherTitle
});
}
});
});
});
}
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