Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
ufo-app-web
·
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
陈峰
6 years ago
Commit
5bc334a513451ad4b495e646013e4e4c94ae4335
1 parent
95dbaa24
commit
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
doraemon/middleware/ssr-api.js
doraemon/middleware/ssr.js
doraemon/middleware/ssr-api.js
View file @
5bc334a
...
...
@@ -5,6 +5,11 @@ const checkParams = require('../../utils/check-params');
const
apiMaps
=
require
(
'../../config/api-map'
);
module
.
exports
=
async
(
req
,
res
,
next
)
=>
{
res
.
set
({
'Cache-Control'
:
'no-cache'
,
Pragma
:
'no-cache'
,
Expires
:
(
new
Date
(
1900
,
0
,
1
,
0
,
0
,
0
,
0
)).
toUTCString
()
});
const
apiInfo
=
apiMaps
[
req
.
path
];
if
(
!
apiInfo
)
{
...
...
doraemon/middleware/ssr.js
View file @
5bc334a
...
...
@@ -73,6 +73,11 @@ const getCacheKey = (urlPath, cackeKey = '') => {
const
render
=
(
route
)
=>
{
return
async
(
req
,
res
,
next
)
=>
{
try
{
res
.
set
({
'Cache-Control'
:
'no-cache'
,
Pragma
:
'no-cache'
,
Expires
:
(
new
Date
(
1900
,
0
,
1
,
0
,
0
,
0
,
0
)).
toUTCString
()
});
res
.
setHeader
(
'X-YOHO-Version'
,
pkg
.
version
);
const
isDegrade
=
_
.
get
(
req
.
app
.
locals
.
wap
,
'webapp.degrade'
,
false
);
...
...
Please
register
or
login
to post a comment