Showing
1 changed file
with
9 additions
and
0 deletions
@@ -18,6 +18,11 @@ const helpers = global.yoho.helpers; | @@ -18,6 +18,11 @@ const helpers = global.yoho.helpers; | ||
18 | * @param next | 18 | * @param next |
19 | */ | 19 | */ |
20 | exports.address = (req, res, next) => { | 20 | exports.address = (req, res, next) => { |
21 | + if (!req.user.uid) { | ||
22 | + res.status(400).send({ error: 'no user' }); | ||
23 | + return; | ||
24 | + } | ||
25 | + | ||
21 | let responseData = { | 26 | let responseData = { |
22 | module: 'home', | 27 | module: 'home', |
23 | page: 'address', | 28 | page: 'address', |
@@ -42,6 +47,10 @@ exports.address = (req, res, next) => { | @@ -42,6 +47,10 @@ exports.address = (req, res, next) => { | ||
42 | * @param next | 47 | * @param next |
43 | */ | 48 | */ |
44 | exports.addressAct = (req, res, next) => { | 49 | exports.addressAct = (req, res, next) => { |
50 | + if (!req.user.uid) { | ||
51 | + res.status(400).send({ error: 'no user' }); | ||
52 | + return; | ||
53 | + } | ||
45 | addressModel.address({ | 54 | addressModel.address({ |
46 | id: req.params.id, | 55 | id: req.params.id, |
47 | uid: req.user.uid | 56 | uid: req.user.uid |
-
Please register or login to post a comment