Authored by 陈峰

Merge branch 'qCloud' of http://git.yoho.cn/fe/yohobuywap-node into qCloud

... ... @@ -16,6 +16,7 @@ const path = require('path');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const favicon = require('serve-favicon');
const uuid = require('uuid');
const pkg = require('./package.json');
const session = require('cookie-session');
... ... @@ -66,6 +67,12 @@ app.use((req, res, next) => {
req.user = {}; // 全局的用户数据
req.yoho = {}; // req和res绑定yoho对象,用于传递全局数据, 如req.yoho.channel等
if (!req.session.id) {
req.session.id = uuid.v4();
}
req.sessionID = req.session.id;
next();
});
... ...
... ... @@ -25,7 +25,7 @@ const praiseArticle = (req, res, next) => {
/* 判断参数是否有效 */
let id = req.body.id,
opt = req.body.opt || 'ok',
udid = req.sessionID;
udid = req.sessionID || require('md5')(req.ip) || 'yoho';
if (!stringProcess.isNumeric(id)) {
res.json({ code: 400, message: '非法请求', data: '' });
... ...
... ... @@ -17,10 +17,10 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
api: 'http://api.yoho.cn/',
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/'
singleApi: 'http://single.yoho.cn/'
// api: 'http://api-test1.yohops.com:9999/',
// service: 'http://service-test1.yohops.com:9999/',
... ... @@ -70,7 +70,7 @@ module.exports = {
port: 4444 // influxdb port
},
console: {
level: 'error',
level: isProduction ? 'error' : 'info',
colorize: 'all',
prettyPrint: true
}
... ...
... ... @@ -45,7 +45,6 @@
"ava": "^0.16.0",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.14.0",
"cheerio": "^0.22.0",
"eslint": "^3.0.1",
"eslint-config-yoho": "^1.0.1",
"gulp": "^3.9.1",
... ...