|
@@ -37,7 +37,7 @@ module.exports = app => {
|
|
|
*/
|
|
|
async addLoginLog() {
|
|
|
const { ctx } = this;
|
|
|
- const ip = ctx.header['x-real-ip'] ? ctx.header['x-real-ip'] : '';
|
|
|
+ const ip = ctx.request.ip ? ctx.request.ip : '';
|
|
|
const ipInfo = await this.getIpInfoFromApi(ip);
|
|
|
const parser = new UAParser(ctx.header['user-agent']);
|
|
|
const osInfo = parser.getOS();
|