Authored by 徐炜

Merge branch 'release/1.0'

... ... @@ -41,7 +41,7 @@ const index = (req, res, next) => {
let appType = 1;
brand.getListData(contentCode, channel, appType).then((result) => {
brand.getListData(contentCode, channel, gender, appType).then((result) => {
res.display('index', {
module: 'brand',
page: 'index',
... ...
... ... @@ -107,8 +107,9 @@ const _getResources = (contentCode) => {
* @param channel
* @returns {*}
*/
const _getBreakingSort = (channel, appType) => {
const _getBreakingSort = (channel, gender, appType) => {
return api.get('', {
gender: gender,
yh_channel: channel,
app_type: appType,
method: 'app.brand.newBrandList'
... ... @@ -126,8 +127,8 @@ const _getBreakingSort = (channel, appType) => {
* 获取品牌一览相关数据
* @returns {*}
*/
const getListData = (contentCode, channel, appType) => {
return Promise.all([_getResources(contentCode), _getBreakingSort(channel, appType)])
const getListData = (contentCode, channel, gender, appType) => {
return Promise.all([_getResources(contentCode), _getBreakingSort(channel, gender, appType)])
.then((result) => {
return {
... ...
... ... @@ -7,7 +7,8 @@
const mcHandler = require('../models/menu-crumb-handler');
const addressModel = require('../models/address');
const crypto = global.yoho.crypto;
const config = global.yoho.config;
const config = global.yoho.config
const logger = global.yoho.logger;
const _ = require('lodash');
... ... @@ -95,6 +96,8 @@ const addAddressData = (req, res, next) => {
* 修改地址
*/
const updateAddressData = (req, res, next) => {
logger.info(`address update, address_id decrypt. address_id = ${req.body.id}`);
let id = crypto.decrypt(config.crypto.common, req.body.id);
let uid = req.user.uid;
let address = req.body.address;
... ... @@ -112,6 +115,8 @@ const updateAddressData = (req, res, next) => {
* 删除地址
*/
const delAddressData = (req, res, next) => {
logger.info(`address delete, address_id decrypt. address_id = ${req.body.id}`);
let id = crypto.decrypt(config.crypto.common, req.body.id);
let uid = req.user.uid;
... ... @@ -124,6 +129,8 @@ const delAddressData = (req, res, next) => {
* 设置默认地址
*/
const setDefaultAddress = (req, res) => {
logger.info(`address set default, address_id decrypt. address_id = ${req.body.id}`);
let id = crypto.decrypt(config.crypto.common, req.body.id);
let uid = req.user.uid;
... ...
... ... @@ -13,6 +13,7 @@ const _ = require('lodash');
const helper = global.yoho.helpers;
const crypto = global.yoho.crypto;
const config = global.yoho.config;
const logger = global.yoho.logger;
// 结算页面
const index = (req, res, next) => {
... ... @@ -93,6 +94,7 @@ const orderSub = (req, res, next) => {
});
return;
} else {
logger.info(`order submit, address_id decrypt. address_id = ${other.address_id}`);
other.address_id = crypto.decrypt(config.crypto.common, other.address_id);
}
... ...