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
刘传洋
8 years ago
Commit
957c53a18a4e5edb8576515bb849d0233159a3ba
1 parent
2391cbf5
cache pc -> h5 share
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
doraemon/middleware/mobile-refer.js
doraemon/middleware/sub-domain.js
doraemon/middleware/mobile-refer.js
View file @
957c53a
...
...
@@ -34,7 +34,7 @@ module.exports = () => {
let
domain
=
'm.yohobuy.com'
;
let
proReg
=
/^
\/
product
\/
pro/
,
guangReg
=
/^
\/
guang/
,
guangDetailReg
=
/
.html$
/
,
guangDetailReg
=
/
\/
guang
\/
info
\/
index
/
,
qsReg
=
/
\?
/
;
if
(
!
req
.
xhr
)
{
...
...
@@ -53,7 +53,7 @@ module.exports = () => {
data
.
mobileRefer
=
`
//guang.${domain}`;
if
(
guangDetailReg
.
test
(
url
))
{
data
.
mobileRefer
+=
url
.
replace
(
/
\/
guang
\/
detail
\/([\d]
+
)
.html/
,
'/info/index?id=$1
'
);
data
.
mobileRefer
+=
url
.
replace
(
/
\/
guang
\/
info
\/
index/
,
'/info/index
'
);
}
else
if
(
url
===
'/guang/Index/editor'
)
{
data
.
mobileRefer
+=
`
/
author
/
index
?
id
=
$
{
req
.
query
.
author_id
}
`
;
}
...
...
doraemon/middleware/sub-domain.js
View file @
957c53a
...
...
@@ -29,8 +29,6 @@ module.exports = () => {
req
.
url
+=
'&'
+
RegExp
.
$3
;
}
req
.
query
.
id
=
RegExp
.
$1
;
console
.
log
(
req
.
url
);
}
else
if
(
!
guangReg
.
test
(
req
.
path
))
{
req
.
url
=
'/guang'
+
req
.
url
;
}
...
...
Please
register
or
login
to post a comment