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
5347cae9
Commit
5347cae9
authored
Sep 10, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发帖时更新后台用户头像与昵称
parent
ea22a43b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
forumThread.js
app/controllers/admin/forumThread.js
+23
-0
No files found.
app/controllers/admin/forumThread.js
View file @
5347cae9
...
...
@@ -65,6 +65,28 @@ router.post('/thread/create', function(req, res, next) {
res
.
json
(
returnCode
.
BUSY
);
}
else
{
if
(
user
)
{
var
icon
=
req
.
session
.
user
.
headPic
,
nickName
=
req
.
session
.
user
.
name
,
isUpdate
=
false
,
updateObj
=
{};
if
(
icon
){
if
(
!
user
.
icon
||
user
.
icon
!=
icon
){
isUpdate
=
true
;
updateObj
.
icon
=
icon
;
}
}
if
(
nickName
){
if
(
!
nickName
||
!
user
.
nickName
||
user
.
nickName
!=
nickName
){
isUpdate
=
true
;
updateObj
.
nickName
=
nickName
;
}
}
if
(
isUpdate
){
user
.
update
(
updateObj
,
function
(
err
,
data
){
if
(
err
)
console
.
log
(
err
);
});
}
req
.
body
.
from
=
user
.
_id
;
forumThreadService
.
createThread
(
req
.
body
,
function
(
err
,
entity
)
{
if
(
err
)
{
...
...
@@ -80,6 +102,7 @@ router.post('/thread/create', function(req, res, next) {
}
else
{
var
entity
=
{
uid
:
uid
,
ent_code
:
req
.
session
.
user
.
ent_code
,
nickName
:
req
.
session
.
user
.
name
,
icon
:
req
.
session
.
user
.
headPic
};
...
...
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