Subject subject = SecurityUtils.getSubject();
Sys_user user = (Sys_user) subject.getPrincipal();
String ip = user.getLoginIp();
发现 部署到服务器 一直显示,127.0.0.1
我应该怎么获取用户的真实访问ip呢?
Subject subject = SecurityUtils.getSubject();
Sys_user user = (Sys_user) subject.getPrincipal();
String ip = user.getLoginIp();
发现 部署到服务器 一直显示,127.0.0.1
我应该怎么获取用户的真实访问ip呢?
ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 100.0.112.43 netmask 255.255.0.0 broadcast 13.0.255.255
ether 00:16:3e:08:25:56 txqueuelen 1000 (Ethernet)
RX packets 318268953 bytes 27707856340 (25.8 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 265394345 bytes 45484233592 (42.3 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1 (Local Loopback)
RX packets 3295965 bytes 204358214 (194.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3295965 bytes 204358214 (194.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
服务器的ip