Authored by 郝肖肖

is not isvalid function

@@ -16,7 +16,7 @@ module.exports = (req, res, next) => { @@ -16,7 +16,7 @@ module.exports = (req, res, next) => {
16 16
17 let loginPage = helpers.urlFormat('/passport/login', {refer: req.fullUrl()}); 17 let loginPage = helpers.urlFormat('/passport/login', {refer: req.fullUrl()});
18 18
19 - if (_.isEmpty(req.user) || !req.user.uid.isValid()) { 19 + if (_.isEmpty(req.user) || !req.user.uid || !req.user.uid.isValid()) {
20 if (req.xhr) { 20 if (req.xhr) {
21 return res.json({ 21 return res.json({
22 code: 400, 22 code: 400,