修复了IP格式化导致的登录不了的Bug
parent
cc39e36c33
commit
f2f6bb8d8a
|
@ -16,7 +16,10 @@ public class IPAddress {
|
||||||
|
|
||||||
public static IPAddress of(String ip) {
|
public static IPAddress of(String ip) {
|
||||||
long ipHex = 0;
|
long ipHex = 0;
|
||||||
ip = ip.substring(0, ip.indexOf(':'));
|
int portIndex = ip.indexOf(':');
|
||||||
|
if (portIndex != -1) {
|
||||||
|
ip = ip.substring(0, ip.indexOf(':'));
|
||||||
|
}
|
||||||
String[] split = ip.split("\\.");
|
String[] split = ip.split("\\.");
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
ipHex = (ipHex << 8) + Integer.parseInt(s);
|
ipHex = (ipHex << 8) + Integer.parseInt(s);
|
||||||
|
|
|
@ -22,7 +22,9 @@ public class SerializeTests {
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Test
|
@Test
|
||||||
public void serializeTime() {
|
public void serializeTime() {
|
||||||
System.out.println(objectMapper.readValue("1657166400", LocalDateTime.class));
|
String timestamp = objectMapper.writeValueAsString(LocalDateTime.now());
|
||||||
|
System.out.println(timestamp);
|
||||||
|
System.out.println(objectMapper.readValue(timestamp, LocalDateTime.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
|
|
Loading…
Reference in New Issue