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
4bdacea3
Commit
4bdacea3
authored
Aug 03, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
27bf9dff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
forumThread.js
app/controllers/admin/forumThread.js
+13
-10
express.js
config/express.js
+2
-1
No files found.
app/controllers/admin/forumThread.js
View file @
4bdacea3
...
...
@@ -616,17 +616,20 @@ router.post('/thread/comment/add', function(req, res, next) {
});
}
else
{
var
icon
=
req
.
session
.
user
.
headPic
;
if
(
icon
.
indexOf
(
'http://'
)
==
-
1
){
icon
=
req
.
host
!=
'piplus.wxpai.cn'
?
'http://img3.wxpai.cn/'
+
icon
:
'http://img2.wxpai.cn/'
+
icon
;
}
if
(
icon
&&
(
!
user
.
icon
||
user
.
icon
!==
icon
)){
forumUserService
.
updateUserById
(
user
.
_id
,{
icon
:
icon
},
function
(
err
){
if
(
err
){
console
.
log
(
err
);
}
});
if
(
icon
){
if
(
icon
.
indexOf
(
'http://'
)
==
-
1
){
icon
=
req
.
host
!=
'piplus.wxpai.cn'
?
'http://img3.wxpai.cn/'
+
icon
:
'http://img2.wxpai.cn/'
+
icon
;
}
if
(
icon
&&
(
!
user
.
icon
||
user
.
icon
!==
icon
)){
forumUserService
.
updateUserById
(
user
.
_id
,{
icon
:
icon
},
function
(
err
){
if
(
err
){
console
.
log
(
err
);
}
});
}
}
entity
.
from
=
user
;
callback
();
}
...
...
config/express.js
View file @
4bdacea3
...
...
@@ -8,7 +8,7 @@ var methodOverride = require('method-override');
var
session
=
require
(
'express-session'
);
var
redisStore
=
require
(
'connect-redis'
)(
session
);
var
multiparty
=
require
(
'connect-multiparty'
);
var
cookieParser
=
require
(
'cookie-parser'
);
var
forumUser
=
require
(
'../app/utils/user'
);
module
.
exports
=
function
(
app
,
config
)
{
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
...
...
@@ -21,6 +21,7 @@ module.exports = function(app, config) {
extended
:
true
}));
app
.
use
(
compress
());
app
.
use
(
cookieParser
());
app
.
use
(
methodOverride
());
app
.
use
(
multiparty
());
app
.
use
(
session
({
...
...
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