后台:跑马灯

This commit is contained in:
luying
2021-12-09 20:38:23 +08:00
parent 3db2735d6e
commit ecca95b40b
12 changed files with 187 additions and 94 deletions

View File

@@ -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();