...
|
...
|
@@ -53,31 +53,6 @@ const asyncLoadScripts = (renderScripts) => { |
|
|
return scripts;
|
|
|
};
|
|
|
|
|
|
const versionToNumber = (str, len = 3) => {
|
|
|
let verNum = 0;
|
|
|
const ver = str.split('.').map(i => Number(i));
|
|
|
|
|
|
for (let i = 0; i < len; i++) {
|
|
|
verNum += (ver[i] || 0) * Math.pow(100, len - i - 1);
|
|
|
}
|
|
|
|
|
|
return verNum;
|
|
|
};
|
|
|
|
|
|
const getImmersedStatus = (req) => {
|
|
|
let status = false;
|
|
|
|
|
|
if (req.yoho.isYohoApp && req.yoho.isiOS) {
|
|
|
let appVersion = req.cookies.app_version || req.query.app_version;
|
|
|
|
|
|
if (appVersion && versionToNumber(appVersion) >= versionToNumber('6.9.2')) {
|
|
|
status = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return status;
|
|
|
};
|
|
|
|
|
|
const getContext = (req) => {
|
|
|
return {
|
|
|
url: req.url,
|
...
|
...
|
@@ -184,8 +159,7 @@ const render = (route) => { |
|
|
resources,
|
|
|
states,
|
|
|
zk,
|
|
|
routeHash: routeEncode.getRouter(req),
|
|
|
needImmersed: getImmersedStatus(req)
|
|
|
routeHash: routeEncode.getRouter(req)
|
|
|
});
|
|
|
|
|
|
if (config.useCache && route.cache && ck) {
|
...
|
...
|
@@ -252,8 +226,7 @@ const devRender = (route) => { |
|
|
scripts,
|
|
|
resources,
|
|
|
states,
|
|
|
routeHash: routeEncode.getRouter(req),
|
|
|
needImmersed: getImmersedStatus(req)
|
|
|
routeHash: routeEncode.getRouter(req)
|
|
|
});
|
|
|
|
|
|
if (config.useCache && route.cache && ck) {
|
...
|
...
|
|