Authored by ccbikai(👎🏻🍜)

Merge branch 'master' into release/5.4.1

... ... @@ -17,6 +17,7 @@ exports.productLst = function(req, res, next) {
specified_sort: req.query.enum,
stocknumber: req.query.sn,
p_d: req.query.pd,
noDup: req.query.noDup,
limit: req.query.limit || 10
};
... ...
/**
* 唤起苹果 app 配置文件
*/
'use strict';
let configFile = `
{
"applinks": {
"apps": [],
"details": [
{
"appID": "6U82P566A4.com.yoho.buy",
"paths": [ "*"]
},
{
"appID": "EX33S4LRW7.com.yoho.buy",
"paths": [ "*" ]
}
]
}
}
`;
const appSiteAssociation = (req, res) => {
res.set('Content-Disposition', 'attachment; filename="apple-app-site-association"');
res.send(configFile);
};
module.exports = {
appSiteAssociation
};
... ...
... ... @@ -13,12 +13,13 @@ var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
const uploadApi = require(cRoot + '/upload.js');
const hotfix = require(`${cRoot}/hotfix`);
const apple = require(`${cRoot}/apple`);
// routers
router.post('/api/upload/image', multipartMiddleware, uploadApi.uploadImg);
router.post('/hf/v1', hotfix.v1);
router.get('/.well-known/apple-app-site-association', apple.appSiteAssociation);
module.exports = router;
... ...
... ... @@ -24,7 +24,7 @@ const bind = {
indexPage: (req, res) => {
// 如果没有originalUrl,判定为非法链接
if (req.session.originalUrl !== 'true') {
res.redirect('//m.yohobuy.com');
return res.redirect('//m.yohobuy.com');
}
let refer = req.get('Referer');
... ...
... ... @@ -22,7 +22,7 @@ const list = (req, res, next) => {
cartUrl: helpers.urlFormat('/cart/index/index')
}, req.query);
let title = '';
let query = req.query.query;
let query = (req.query.query || '').toString();
let isQueryFirstClass = false; // 标识用户搜的是不是一级品类
let isQuerySecondClass = false; // 标识用户搜的是不是二级品类
let domain = null;
... ...
... ... @@ -76,7 +76,7 @@ module.exports = {
port: '4444' // influxdb port
},
console: {
level: 'info',
level: 'debug',
colorize: 'all',
prettyPrint: true
}
... ...
... ... @@ -12,7 +12,7 @@
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.2.4/yas.js', '_yas'));
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.2.5/yas.js', '_yas'));
var _hmt = _hmt || [];
... ... @@ -56,7 +56,7 @@
uid = uid === 0 ? '' : uid;
window._ozuid = uid; // 暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '2.2.2', 'yohobuy_m', uid, '', '');
window._yas(1 * new Date(), '2.2.5', 'yohobuy_m', uid, '', '');
}
setTimeout(function() {
... ...
{
"name": "m-yohobuy-node",
"version": "5.4.7",
"version": "5.4.8",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -406,7 +406,7 @@ function search(opt) {
if (nav.reload) {
page = 1;
} else if (nav.end) {
$('.search-divide').remove();
// 不需要重新加载并且数据请求结束
return;
}
... ... @@ -583,7 +583,6 @@ function search(opt) {
if (data === '' || (data.list && data.list.length <= 0)) {
nav.end = true;
$('.search-divide').remove();
if (nav.reload) {
if (data.total === 0) {
$container.html(noResult);
... ...
... ... @@ -52,6 +52,12 @@ const toArray = (obj) => {
const _sortListByField = (list, key, desc) => {
let array = toArray(list);
return array.sort(function(a, b) {
a = a._key.split(',')[0] * 1;
b = b._key.split(',')[0] * 1;
return desc ? a < b : a > b;
});
/*
array = array.sort((a, b) => {
let matchNumber = /([\d]+)/g;
... ... @@ -70,7 +76,7 @@ const _sortListByField = (list, key, desc) => {
return numA < numB ? -1 : 1;
});
return array;
return array;*/
};
/**
... ...