Authored by zhangxiaoru

favoritemore

... ... @@ -42,19 +42,19 @@ exports.address = (req, res, next) => {
* @param next
*/
exports.addressAct = (req, res, next) => {
let responseData = {
module: 'home',
page: 'address-act',
pageHeader: headerModel.setNav({
navTitle: '编辑地址'
}),
title: '编辑地址'
};
addressModel.address({
id: req.params.id,
uid: req.user.uid || 8039759 // TODO 待删除
}).then(result => {
let responseData = {
module: 'home',
page: 'address-act',
pageHeader: headerModel.setNav({
navTitle: result.navTitle
}),
title: result.navTitle
};
res.render('address/address-act', Object.assign(responseData, result));
}).catch(next);
};
... ...
... ... @@ -110,11 +110,13 @@ const address = (params) => {
return o.address_id === params.id;
})),
addressList: camelCase(result[1] ? result[1].data : []),
addressActionPage: true
navTitle: '编辑地址'
};
} else {
return {
address: camelCase(selfAddress.data)
address: camelCase(selfAddress.data),
addressList: camelCase(result[1] ? result[1].data : []),
navTitle: '添加地址'
};
}
}
... ... @@ -127,7 +129,7 @@ const address = (params) => {
*/
const saveAddress = (params) => {
if (params.id) {
params.id = crypto.encryption(null, params.id);
params.id = crypto.decrypt(null, params.id);
}
return _saveAddressData(params).then(result => {
return result;
... ...