Authored by 郭成尧

uid-handle

... ... @@ -59,7 +59,7 @@ const collectArticle = (req, res, next) => {
/* 判断用户是否登录 */
let id = req.body.id,
opt = req.body.opt || 'ok',
uid = req.body.uid;
uid = req.user.uid;
/* 判断是不是登录成功 */
if (!uid) {
... ... @@ -112,7 +112,7 @@ const favoriteBrand = (req, res, next) => {
/* 判断参数是否有效 */
let id = req.body.id,
opt = req.body.opt || 'ok',
uid = req.user.uid || (req.body.uid && parseInt(req.body.uid, 10)) || req.cookies.appUid,
uid = req.user.uid,
isBrand = req.body.isBrand;
if (!stringProcess.isNumeric(id) || !stringProcess.isNumeric(uid)) {
... ...
... ... @@ -105,18 +105,12 @@ exports.indexRedirect = (req, res) => {
exports.userSkn = (req, res, next) => {
let isApp = req.body.app_version || req.body.appVersion || false;
let uid = '';
let uid = req.user.uid;
let param = {};
let skns = req.body.skns || '';
skns = skns.split(',') || [];
if (req.yoho.isApp) {
uid = req.body.uid;
} else {
uid = req.user.uid;
}
if (uid) {
param.uid = uid;
param.content_code = req.body.code || '';
... ...
... ... @@ -134,19 +134,11 @@ exports.getDetailData = (req, res, next) => {
* [品牌详情异步数据]
*/
exports.getDetailDataAsync = (req, res, next) => {
let uid;
let uid = req.user.uid;
let udid = req.sessionID || 'yoho';
let brandId = req.body.brand_id || 0;
let isApp = req.body.isApp || false;
if (isApp) {
if (req.body.uid) {
uid = parseInt(req.body.uid, 10);
}
} else {
uid = req.user.uid;
}
if (!brandId) {
return res.json({code: 400, message: '参数错误'});
}
... ...
... ... @@ -274,13 +274,12 @@ const remind = (req, res) => {
on_off: req.body.on_off === 'true' ? true : false,
activity_id: Number.parseInt(req.body.activity_id, 10),
product_skn: Number.parseInt(req.body.product_skn, 10),
uid: Number.parseInt(req.body.uid, 10),
uid: req.user.uid,
sec_kill_id: Number.parseInt(req.body.sec_kill_id, 10),
app_type: 0
})
.then(result => {
return res.json(result);
});
}).then(result => {
return res.json(result);
});
};
// Middleware:检测 app_version 是否正确
... ...