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
a12b88c3b14a57da3c720f75b3cc1a2f0db2441d
1 parent
b36c4b59
'download-v2'
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
apps/activity/controllers/market.js
apps/activity/router.js
apps/activity/controllers/market.js
View file @
a12b88c
...
...
@@ -7,6 +7,7 @@
'use strict'
;
const
indexModel
=
require
(
'../models/market'
);
const
_
=
require
(
'lodash'
);
exports
.
index
=
(
req
,
res
,
next
)
=>
{
...
...
@@ -21,3 +22,26 @@ exports.index = (req, res, next) => {
}).
catch
(
next
);
};
/**
* 市场推广活动升级版,自定义下载渠道
* @param req
* @param res
* @param next
*/
exports
.
v2
=
(
req
,
res
,
next
)
=>
{
indexModel
.
index
({
}).
then
((
result
)
=>
{
if
(
_
.
has
(
result
,
'download[0].url'
)
&&
req
.
query
.
union_type
)
{
result
.
download
[
0
].
url
=
result
.
download
[
0
].
url
.
split
(
'?'
)[
0
]
+
'?union_type='
+
req
.
query
.
union_type
;
}
res
.
render
(
'market/market'
,
Object
.
assign
(
result
,
{
title
:
'Yoho!Buy 有货'
}));
}).
catch
(
next
);
};
...
...
apps/activity/router.js
View file @
a12b88c
...
...
@@ -71,6 +71,7 @@ router.get('/invite', invite.checkType, invite.index);
router
.
get
(
'/invite/index'
,
invite
.
checkType
,
invite
.
index
);
router
.
get
(
'/market'
,
market
.
index
);
// 市场推广活动
router
.
get
(
'/market/v2'
,
market
.
v2
);
// 市场推广活动升级版,自定义下载渠道
router
.
get
(
/
\/
invite
\/
share_
([\d]
+
)
_
([\d]
+
)
_
([\d]
+
)
.html/
,
invite
.
checkType
,
invite
.
share
);
...
...
Please
register
or
login
to post a comment