后台:跑马灯
This commit is contained in:
@@ -3,7 +3,7 @@ import { Context } from 'egg';
|
||||
module.exports = () => {
|
||||
return async function parmsDecode(ctx: Context, next) {
|
||||
|
||||
let xRealIp = typeof ctx.header['x-real-ip'] == 'string'? ctx.header['x-real-ip']: ctx.header['x-real-ip'][0];
|
||||
let xRealIp = ctx.header['x-real-ip'] && (typeof ctx.header['x-real-ip'] == 'string'? ctx.header['x-real-ip']: ctx.header['x-real-ip'][0]);
|
||||
ctx.clientIp = xRealIp||ctx.request.ip;
|
||||
console.log('*****', ctx.clientIp);
|
||||
await next();
|
||||
|
||||
Reference in New Issue
Block a user