[release-2.17] refactor: remove IP address judgment for device management (#6279)

This is an automated cherry-pick of #6275

/assign JohnNiang

```release-note
设备管理去除 IP 地址检查以避免频繁登录
```
pull/6281/head
Halo Dev Bot 2024-07-05 17:49:08 +08:00 committed by GitHub
parent c5bf1924a6
commit 06c957aa7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

View File

@ -100,10 +100,7 @@ public class DeviceServiceImpl implements DeviceService {
var userAgent =
exchange.getRequest().getHeaders().getFirst(HttpHeaders.USER_AGENT);
var deviceUa = existingDevice.getSpec().getUserAgent();
var ipAddr = existingDevice.getSpec().getIpAddress();
var clientIp = getClientIp(exchange.getRequest());
if (!StringUtils.equals(deviceUa, userAgent)
|| !StringUtils.equals(clientIp, ipAddr)) {
if (!StringUtils.equals(deviceUa, userAgent)) {
// User agent changed, create a new device
return Mono.empty();
}