...
|
...
|
@@ -8,6 +8,7 @@ const mcHandler = require('../models/menu-crumb-handler'); |
|
|
const addressModel = require('../models/address');
|
|
|
const crypto = global.yoho.crypto;
|
|
|
const config = global.yoho.config;
|
|
|
const logger = global.yoho.logger;
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
...
|
...
|
@@ -84,7 +85,8 @@ const addAddressData = (req, res, next) => { |
|
|
|
|
|
addressModel.addAddressData(uid, address, areaCode, consignee, mobile, phone, isInit).then(result => {
|
|
|
if (result.data && result.data.address_id) {
|
|
|
result.data.aid = crypto.encryption(config.crypto.common, result.data.address_id + '');
|
|
|
result.data.address_id = crypto.encryption(config.crypto.common, result.data.address_id + '');
|
|
|
result.data.aid = result.data.address_id;
|
|
|
}
|
|
|
|
|
|
res.send(result);
|
...
|
...
|
@@ -95,6 +97,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 +116,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 +130,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;
|
|
|
|
...
|
...
|
|