优化无法登录的错误
This commit is contained in:
@@ -31,8 +31,19 @@ function normalizeGeo(geo) {
|
||||
}
|
||||
|
||||
async function getLocation(target) {
|
||||
// Normalize target (strip port if present)
|
||||
const cleanTarget = target.split(':')[0];
|
||||
// Normalize target (strip port if present, handle IPv6 brackets)
|
||||
let cleanTarget = target;
|
||||
if (cleanTarget.startsWith('[')) {
|
||||
const closingBracket = cleanTarget.indexOf(']');
|
||||
if (closingBracket !== -1) {
|
||||
cleanTarget = cleanTarget.substring(1, closingBracket);
|
||||
}
|
||||
} else {
|
||||
const parts = cleanTarget.split(':');
|
||||
if (parts.length === 2) {
|
||||
cleanTarget = parts[0];
|
||||
}
|
||||
}
|
||||
|
||||
// 1. Check if we already have this IP/Domain in DB (FASTEST)
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user