Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
htoooth
7 years ago
Commit
1f54583074ab4faab7581ebb1acdc6c8b6687569
1 parent
bf4d8c79
fix
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
app.js
package.json
app.js
View file @
1f54583
...
...
@@ -61,6 +61,11 @@ app.enable('trust proxy');
app
.
set
(
'subdomain offset'
,
2
);
app
.
use
((
req
,
res
,
next
)
=>
{
req
.
isApmReport
=
_
.
get
(
req
.
app
.
locals
,
'pc.open.bughd'
,
false
);
next
();
});
// 添加请求上下文
app
.
use
(
global
.
yoho
.
httpCtx
());
...
...
@@ -86,7 +91,6 @@ require('./doraemon/middleware/yoho-session')(app);
app
.
use
((
req
,
res
,
next
)
=>
{
req
.
user
=
{};
// 全局的用户数据
req
.
yoho
=
{};
// req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等
req
.
isApmReport
=
_
.
get
(
req
.
app
.
locals
,
'pc.open.bughd'
,
false
);
if
(
!
req
.
session
)
{
req
.
session
=
{};
...
...
package.json
View file @
1f54583
...
...
@@ -57,7 +57,7 @@
"urlencode"
:
"^1.1.0"
,
"uuid"
:
"^2.0.2"
,
"yoho-express-session"
:
"^2.0.0"
,
"yoho-node-lib"
:
"=0.5.
29
"
,
"yoho-node-lib"
:
"=0.5.
30
"
,
"yoho-zookeeper"
:
"^1.0.8"
},
"devDependencies"
:
{
...
...
Please
register
or
login
to post a comment