Authored by 郭成尧

geetest-lib-load-before

... ... @@ -14,12 +14,12 @@ exports.index = (req, res) => {
req.yoho.captchaShow = false;
res.locals.useGeetest = true;
if (_.has(res, 'locals.loadJs')) {
res.locals.loadJs.push({
if (_.has(res, 'locals.loadJsBefore')) {
res.locals.loadJsBefore.push({
src: global.yoho.config.geetestJs
});
} else {
res.locals.loadJs = [
res.locals.loadJsBefore = [
{
src: global.yoho.config.geetestJs
}
... ...
... ... @@ -26,12 +26,12 @@ const load = (req, res, next) => {
res.locals.useGeetest = !req.yoho.captchaShow;
if (_.has(res, 'locals.loadJs')) {
res.locals.loadJs.push({
if (_.has(res, 'locals.loadJsBefore')) {
res.locals.loadJsBefore.push({
src: global.yoho.config.geetestJs
});
} else {
res.locals.loadJs = [
res.locals.loadJsBefore = [
{
src: global.yoho.config.geetestJs
}
... ...
... ... @@ -132,6 +132,9 @@
var STATIC_RESOURCE_HASH = '{{startTime}}';
var STATIC_RESOURCE_PATH = '//{{devHost}}:{{port}}';
window.jsFiles = [
{{#loadJsBefore}}
'{{src}}',
{{/loadJsBefore}}
'//{{devHost}}:{{port}}/libs.js?t={{startTime}}',
'//{{devHost}}:{{port}}/{{module}}.{{page}}.js?t={{startTime}}'
{{#loadJs}}
... ... @@ -144,6 +147,9 @@
var STATIC_RESOURCE_HASH = '{{startTime}}';
var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/yohobuywap-node/{{version}}';
window.jsFiles = [
{{#loadJsBefore}}
'{{src}}',
{{/loadJsBefore}}
'//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}',
'//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}'
{{#loadJs}}
... ...