后台:修改白名单

This commit is contained in:
luying
2021-12-08 17:35:23 +08:00
parent fc38485f94
commit 46108f90f2
14 changed files with 56 additions and 43 deletions
+12
View File
@@ -0,0 +1,12 @@
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];
ctx.clientIp = xRealIp||ctx.request.ip;
console.log('*****', ctx.clientIp);
await next();
};
};