...
|
...
|
@@ -80,7 +80,8 @@ const getContext = (req) => { |
|
|
function getAppPath(req) {
|
|
|
let appPathUrl = req.originalUrl.split('?')[0] || '';
|
|
|
const query = Object.assign(req.query, {
|
|
|
headerid: -1
|
|
|
headerid: -1,
|
|
|
toplayoutByH5: 'Y'
|
|
|
});
|
|
|
|
|
|
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.h5",' +
|
...
|
...
|
@@ -90,6 +91,14 @@ function getAppPath(req) { |
|
|
return encodeURI(appPath);
|
|
|
}
|
|
|
|
|
|
function getShare(req) {
|
|
|
if ('share' in req.query) {
|
|
|
return req.query.share === 'true' ? true : false;
|
|
|
} else {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const handlerError = (err = {}, req, res, next) => {
|
|
|
if (err.code === 404) {
|
|
|
return res.redirect('/grass/error/404');
|
...
|
...
|
@@ -194,7 +203,7 @@ const render = (route) => { |
|
|
resources,
|
|
|
states,
|
|
|
zk,
|
|
|
download: req.query.share ? true : false,
|
|
|
download: getShare(req),
|
|
|
routeHash: routeEncode.getRouter(req),
|
|
|
appPath: getAppPath(req)
|
|
|
});
|
...
|
...
|
@@ -267,7 +276,7 @@ const devRender = (route) => { |
|
|
resources,
|
|
|
states,
|
|
|
routeHash: routeEncode.getRouter(req),
|
|
|
download: req.query.share ? true : false,
|
|
|
download: getShare(req),
|
|
|
appPath: getAppPath(req)
|
|
|
});
|
|
|
|
...
|
...
|
|