Authored by 陈峰

Merge branch 'release/10.10' into 'master'

Release/10.10



See merge request !1552
... ... @@ -2,7 +2,7 @@ const shelljs = require('shelljs');
const yargs = require('yargs');
const path = require('path');
const cssnano = require('cssnano');
const request = require('request');
const rp = require('request-promise');
const fs = require('fs');
const pkg = require('../package.json');
... ... @@ -33,19 +33,30 @@ new Promise((resolve, reject) => { // 加载manifest.json文件
cpPaths.push(`dist/statics/yohobuywap-node/${pkg.version}/manifest.json`);
resolve();
} else {
request({
url: `https://cdn.yoho.cn/yohobuywap-node/${pkg.version}/manifest.json`,
gzip: true,
json: true
}, (error, response, data) => {
if (error || !data || data.error) {
return reject(`download manifest.json faild:${error || !data || data.error}`);
return Promise.all([
rp({
url: `https://cdn.yoho.cn/yohobuywap-node/${pkg.version}/manifest.json`,
gzip: true,
json: true
}),
rp({
url: 'https://m.yohobuy.com/sw.js',
gzip: true
}),
]).then(results => {
const [manifest, sw] = results;
if (!manifest || !sw) {
throw 'manifest.json or sw.js download faild';
}
fs.writeFileSync(path.join(distDir, 'manifest.json'), JSON.stringify(data), {
fs.writeFileSync(path.join(distDir, 'manifest.json'), JSON.stringify(manifest), {
flag: 'w'
});
fs.writeFileSync(path.join(__dirname, '../public/static/sw.js'), sw, {
flag: 'w'
});
resolve();
});
}).catch(reject);
}
}).then(() => { // 拷贝node代码
cpPaths.forEach(p => {
... ...
{
"name": "yohobuywap-node",
"version": "6.7.13",
"version": "6.7.14",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -88,7 +88,7 @@
"xml2js": "^0.4.19",
"yoho-express-session": "^2.0.0",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "=0.6.32",
"yoho-node-lib": "=0.6.33",
"yoho-zookeeper": "^1.0.10"
},
"devDependencies": {
... ...
... ... @@ -244,13 +244,14 @@ cHammer.on('tap', function() {
$search.on('touchend', function() {
let $buriedpoint = $form.find('.buriedpoint');
let inputQuery = $buriedpoint.val();
if ($buriedpoint.val() === '') {
$buriedpoint.val($('#default-terms').val());
if (inputQuery === '') {
inputQuery = $('#default-terms').val();
}
// 保存搜索的内容
writeSearch.setHistoryValFun($buriedpoint.val());
writeSearch.setHistoryValFun(inputQuery);
if (security.hasDangerInput()) {
return false;
... ... @@ -261,15 +262,14 @@ $search.on('touchend', function() {
op: 'YB_KEYWORD_SEARCH_C',
param: JSON.stringify({
C_ID: C_ID,
KEYWORD: $buriedpoint.val(),
KEYWORD: inputQuery,
POS_ID: 0,
FLR_INDEX: 0
})
}, true);
}
$(this).closest('form').submit();
return false;
goSearch(inputQuery);
});
// 初始化历史搜索的内容
... ...
... ... @@ -132,3 +132,4 @@ self.workbox.routing.registerRoute(args => {
})
]}).handle(args);
});
... ...
... ... @@ -4778,9 +4778,9 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
influx-batch-sender@^0.1.6:
version "0.1.6"
resolved "http://npm.yohops.com/influx-batch-sender/-/influx-batch-sender-0.1.6.tgz#fe4fb11ac80ece3ca791e40c8de098ce0181d499"
influx-batch-sender@^0.1.7:
version "0.1.7"
resolved "http://npm.yohops.com/influx-batch-sender/-/influx-batch-sender-0.1.7.tgz#9f925bfc500e886cae27001b3cc20f2584fa464a"
dependencies:
debug "^3.0.1"
lodash "^4.17.4"
... ... @@ -11102,13 +11102,13 @@ yoho-md5@^2.0.0:
version "2.1.0"
resolved "http://npm.yohops.com/yoho-md5/-/yoho-md5-2.1.0.tgz#f0c00d343f775e77952ebce0826863ac52e0ad50"
yoho-node-lib@=0.6.32:
version "0.6.32"
resolved "http://npm.yohops.com/yoho-node-lib/-/yoho-node-lib-0.6.32.tgz#285b9c89445ed3e6aed9e2cdd4efb7637652a375"
yoho-node-lib@=0.6.33:
version "0.6.33"
resolved "http://npm.yohops.com/yoho-node-lib/-/yoho-node-lib-0.6.33.tgz#fca4dadedb80438d30d06fbb386d09912a4f9ca6"
dependencies:
dnscache "^1.0.1"
handlebars "^4.0.5"
influx-batch-sender "^0.1.6"
influx-batch-sender "^0.1.7"
lodash "^4.13.1"
lru-cache "^4.1.1"
md5 "^2.1.0"
... ...