mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-30 20:35:09 +08:00
修复获取访问ip逻辑
This commit is contained in:
+3
-1
@@ -132,7 +132,8 @@ export async function getNetIp(req: any) {
|
||||
]),
|
||||
];
|
||||
let ip = ipArray[0];
|
||||
console.log(ipArray);
|
||||
console.log(`访问的ip ${ipArray.toString()}`);
|
||||
|
||||
if (ipArray.length > 1) {
|
||||
for (let i = 0; i < ipArray.length; i++) {
|
||||
const ipNumArray = ipArray[i].split('.');
|
||||
@@ -148,6 +149,7 @@ export async function getNetIp(req: any) {
|
||||
continue;
|
||||
}
|
||||
ip = ipArray[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
ip = ip.substr(ip.lastIndexOf(':') + 1, ip.length);
|
||||
|
||||
Reference in New Issue
Block a user