...
|
...
|
@@ -10,6 +10,7 @@ const uuid = require('uuid'); |
|
|
const _ = require('lodash');
|
|
|
const config = global.yoho.config;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const logger = global.yoho.logger;
|
|
|
|
|
|
const _getGender = (channel) => {
|
|
|
switch (channel) {
|
...
|
...
|
@@ -65,6 +66,10 @@ module.exports = () => { |
|
|
// client ip
|
|
|
yoho.clientIp = (function() {
|
|
|
let remoteIp = req.get('X-Forwarded-For') || req.get('X-Real-IP') || req.ip;
|
|
|
let realIp = req.get('X-Real-IP');
|
|
|
let forwardedIp = req.get('X-Forwarded-For');
|
|
|
|
|
|
logger.info(`docker debug real ip: ${realIp}, x-forwarded-for ip: ${forwardedIp}, ip: ${req.ip}`);
|
|
|
|
|
|
if (remoteIp.indexOf(',') > 0) {
|
|
|
let arr = remoteIp.split(',');
|
...
|
...
|
@@ -75,6 +80,7 @@ module.exports = () => { |
|
|
return _.trim(remoteIp);
|
|
|
}());
|
|
|
|
|
|
|
|
|
// uuid
|
|
|
yoho.udid = (function() {
|
|
|
let udid = req.cookies.udid;
|
...
|
...
|
|