...
|
...
|
@@ -7,8 +7,6 @@ |
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
const crypto = global.yoho.crypto;
|
|
|
|
|
|
const pinyin = require('../models/province-pinyin');
|
|
|
const AddressApi = require('../models/address-api');
|
|
|
|
...
|
...
|
@@ -47,10 +45,8 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
dd.default = true;
|
|
|
}
|
|
|
|
|
|
// 地址加密
|
|
|
let id = dd.address_id;
|
|
|
dd.id = dd.address_id;
|
|
|
|
|
|
dd.id = crypto.encryption('', `${id}`);
|
|
|
delete dd.address_id;
|
|
|
delete dd.uid; // 删除uid,用户数据保密
|
|
|
});
|
...
|
...
|
@@ -60,7 +56,6 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
}
|
|
|
|
|
|
delAddressById(uid, id) {
|
|
|
id = parseInt(crypto.decrypt('', `${id}`), 10);
|
|
|
return new AddressApi(this.ctx).delAddressAsync(uid, id);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -68,7 +63,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
let addressApiModel = new AddressApi(this.ctx);
|
|
|
|
|
|
if (info.id) {
|
|
|
let id = parseInt(crypto.decrypt('', `${info.id}`), 10);
|
|
|
let id = info.id;
|
|
|
|
|
|
return addressApiModel.updateAddressAsync(uid, id, info.consignee, info.areaCode, info.address,
|
|
|
info.mobile, info.phone, info.zipCode, info.email);
|
...
|
...
|
@@ -78,7 +73,7 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
if (result.code === 200) {
|
|
|
let d = result.data;
|
|
|
|
|
|
d.id = crypto.encryption('', `${d.address_id}`);
|
|
|
d.id = d.address_id;
|
|
|
delete d.address_id;
|
|
|
delete d.uid;
|
|
|
}
|
...
|
...
|
@@ -90,8 +85,6 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
}
|
|
|
|
|
|
setDefaultAddress(uid, id) {
|
|
|
id = parseInt(crypto.decrypt('', `${id}`), 10);
|
|
|
|
|
|
return new AddressApi(this.ctx).setDefaultAddressAsync(uid, id);
|
|
|
}
|
|
|
}; |
...
|
...
|
|