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
周少峰
8 years ago
Commit
c1fc61322e342c346327991d63853a8d1a91b1d7
1 parent
a77bfbcb
sitemap
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
apps/3party/controllers/sitemap.js
apps/service/router.js
doraemon/middleware/url-rewrite.js
apps/3party/controllers/sitemap.js
View file @
c1fc613
...
...
@@ -7,7 +7,7 @@ const sm = require('sitemap');
const
staticUrls
=
require
(
'../../../config/staticUrls'
);
const
api
=
global
.
yoho
.
API
;
const
Service
=
global
.
yoho
.
ServiceAPI
;
const
redis
=
require
(
'./doraemon/middleware/redis'
);
const
redis
=
require
(
'.
./../..
/doraemon/middleware/redis'
);
const
getStaticUrls
=
(
currentStatics
)
=>
{
let
urls
=
[];
...
...
apps/service/router.js
View file @
c1fc613
...
...
@@ -46,6 +46,6 @@ router.get('/limitcodeColSize', help.limitcodeColSize);// 选择限购码颜色
router
.
get
(
'/limitcodeIntro'
,
help
.
limitcodeIntro
);
// 什么是限购码 (APP使用)
// 站点地图
router
.
get
(
/^
\/
sitemap
(
.
*
)\.
xml/
,
sitemap
.
siteMap
);
router
.
get
(
/^
\/
sitemap
(
\d
*
)\.
xml/
,
sitemap
.
siteMap
);
module
.
exports
=
router
;
...
...
doraemon/middleware/url-rewrite.js
View file @
c1fc613
...
...
@@ -51,7 +51,7 @@ module.exports = () => {
req
.
url
=
'/service/systemUpdate'
;
}
if
(
/^
\/
sitemap
(\d
+
)\.
xml/
.
test
(
req
.
url
))
{
if
(
/^
\/
sitemap
(\d
*
)\.
xml/
.
test
(
req
.
url
))
{
// sitemap/sitemap.xml
req
.
url
=
`
/
service$
{
req
.
url
}
`
;
}
...
...
Please
register
or
login
to post a comment