Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai(👎🏻🍜)
8 years ago
Commit
bdb6b45d9ced1dee6d6e2999ba47632503fd15fd
1 parent
4043437b
serssion ID
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
app.js
config/common.js
app.js
View file @
bdb6b45
...
...
@@ -16,6 +16,7 @@ const path = require('path');
const
bodyParser
=
require
(
'body-parser'
);
const
cookieParser
=
require
(
'cookie-parser'
);
const
favicon
=
require
(
'serve-favicon'
);
const
uuid
=
require
(
'uuid'
);
const
pkg
=
require
(
'./package.json'
);
const
session
=
require
(
'cookie-session'
);
...
...
@@ -66,6 +67,12 @@ app.use((req, res, next) => {
req
.
user
=
{};
// 全局的用户数据
req
.
yoho
=
{};
// req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等
if
(
!
req
.
session
.
id
)
{
req
.
session
.
id
=
uuid
.
v4
();
}
req
.
sessionID
=
req
.
session
.
id
;
next
();
});
...
...
config/common.js
View file @
bdb6b45
...
...
@@ -70,7 +70,7 @@ module.exports = {
port
:
4444
// influxdb port
},
console
:
{
level
:
'
error
'
,
level
:
'
info
'
,
colorize
:
'all'
,
prettyPrint
:
true
}
...
...
Please
register
or
login
to post a comment