Authored by 刘志远

Merge branch 'feature/del-privateIps' into 'master'

加上ip 限制

加上ip 限制

See merge request !108
... ... @@ -5,7 +5,7 @@ module.exports = (req, res, next) => {
try {
const privateIps = _.get(req, 'app.locals.yap.json.privateips', []);
logger.info(`privateIps: ${privateIps.join(',')}`);
logger.info(`privateIps: ${privateIps.join(' | ')}`);
if (_.includes(privateIps, req.yoho.clientIp) || _.get(req, 'app.locals.devEnv', false) ||
_.get(req, 'app.locals.isTest', false)) {
return next();
... ... @@ -15,5 +15,6 @@ module.exports = (req, res, next) => {
}
logger.warn(`[privateips warn], ${req.yoho.clientIp}`);
return next();
return res.status(401).end();
};
... ...