favoritemore
Showing
2 changed files
with
11 additions
and
9 deletions
@@ -42,19 +42,19 @@ exports.address = (req, res, next) => { | @@ -42,19 +42,19 @@ exports.address = (req, res, next) => { | ||
42 | * @param next | 42 | * @param next |
43 | */ | 43 | */ |
44 | exports.addressAct = (req, res, next) => { | 44 | exports.addressAct = (req, res, next) => { |
45 | + addressModel.address({ | ||
46 | + id: req.params.id, | ||
47 | + uid: req.user.uid || 8039759 // TODO 待删除 | ||
48 | + }).then(result => { | ||
45 | let responseData = { | 49 | let responseData = { |
46 | module: 'home', | 50 | module: 'home', |
47 | page: 'address-act', | 51 | page: 'address-act', |
48 | pageHeader: headerModel.setNav({ | 52 | pageHeader: headerModel.setNav({ |
49 | - navTitle: '编辑地址' | 53 | + navTitle: result.navTitle |
50 | }), | 54 | }), |
51 | - title: '编辑地址' | 55 | + title: result.navTitle |
52 | }; | 56 | }; |
53 | 57 | ||
54 | - addressModel.address({ | ||
55 | - id: req.params.id, | ||
56 | - uid: req.user.uid || 8039759 // TODO 待删除 | ||
57 | - }).then(result => { | ||
58 | res.render('address/address-act', Object.assign(responseData, result)); | 58 | res.render('address/address-act', Object.assign(responseData, result)); |
59 | }).catch(next); | 59 | }).catch(next); |
60 | }; | 60 | }; |
@@ -110,11 +110,13 @@ const address = (params) => { | @@ -110,11 +110,13 @@ const address = (params) => { | ||
110 | return o.address_id === params.id; | 110 | return o.address_id === params.id; |
111 | })), | 111 | })), |
112 | addressList: camelCase(result[1] ? result[1].data : []), | 112 | addressList: camelCase(result[1] ? result[1].data : []), |
113 | - addressActionPage: true | 113 | + navTitle: '编辑地址' |
114 | }; | 114 | }; |
115 | } else { | 115 | } else { |
116 | return { | 116 | return { |
117 | - address: camelCase(selfAddress.data) | 117 | + address: camelCase(selfAddress.data), |
118 | + addressList: camelCase(result[1] ? result[1].data : []), | ||
119 | + navTitle: '添加地址' | ||
118 | }; | 120 | }; |
119 | } | 121 | } |
120 | } | 122 | } |
@@ -127,7 +129,7 @@ const address = (params) => { | @@ -127,7 +129,7 @@ const address = (params) => { | ||
127 | */ | 129 | */ |
128 | const saveAddress = (params) => { | 130 | const saveAddress = (params) => { |
129 | if (params.id) { | 131 | if (params.id) { |
130 | - params.id = crypto.encryption(null, params.id); | 132 | + params.id = crypto.decrypt(null, params.id); |
131 | } | 133 | } |
132 | return _saveAddressData(params).then(result => { | 134 | return _saveAddressData(params).then(result => { |
133 | return result; | 135 | return result; |
-
Please register or login to post a comment