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
郝肖肖
7 years ago
Commit
c067fea7ea662491db374d17e9303b79d35c7c5c
1 parent
9d88f081
'微信返回下载注册事件'
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletions
apps/api/controllers/forward.js
apps/api/router.js
public/js/common.js
apps/api/controllers/forward.js
View file @
c067fea
...
...
@@ -21,6 +21,12 @@ const miniapp = (req, res) => {
}).
pipe
(
res
);
// eslint-disable-line
};
// 微信返回下载页
const
download
=
(
req
,
res
)
=>
{
return
res
.
redirect
(
301
,
`
//union.yoho.cn/union/app-downloads.html?union_type=100000000010599`);
};
module
.
exports
=
{
miniapp
miniapp
,
download
};
...
...
apps/api/router.js
View file @
c067fea
...
...
@@ -25,5 +25,6 @@ router.post('/rn/v1', rn.v1);
router
.
get
(
'/.well-known/apple-app-site-association'
,
apple
.
appSiteAssociation
);
router
.
get
(
'/api/wechat/miniapp.jpg'
,
forward
.
miniapp
);
router
.
get
(
'/api/wechat/download'
,
forward
.
download
);
module
.
exports
=
router
;
...
...
public/js/common.js
View file @
c067fea
...
...
@@ -436,6 +436,32 @@ function givePoint(parameter) {
},
true
);
}
function
pushHistory
()
{
var
pages
=
[
'yh_download'
,
'yh_forward'
];
var
state
=
{
title
:
'下载页面'
,
page
:
pages
[
0
],
url
:
'//m.yohobuy.com/api/wechat/download'
};
var
url
=
location
.
href
;
window
.
addEventListener
(
'popstate'
,
function
(
e
)
{
var
temp
=
e
.
state
;
if
(
temp
&&
pages
.
indexOf
(
temp
.
page
)
>
-
1
)
{
location
.
reload
();
}
});
if
(
!
window
.
history
.
pushState
||
window
.
history
.
length
>
1
)
{
return
false
;
}
window
.
history
.
replaceState
(
state
,
null
,
state
.
url
);
window
.
history
.
pushState
({
page
:
pages
[
1
]},
null
,
url
);
}
pushHistory
();
/**
* 页面头颜色修正
...
...
Please
register
or
login
to post a comment