[fix] String类型判断使用StringUtils.isNotEmpty() 而不是Objects.isNull()

This commit is contained in:
yinpeng
2023-05-31 20:51:31 +08:00
parent af9ff9dbae
commit 6986fdfca3
3 changed files with 3 additions and 3 deletions

View File

@@ -34,6 +34,6 @@ public class CursorPageBaseReq {
@JsonIgnore @JsonIgnore
public Boolean isFirstPage() { public Boolean isFirstPage() {
return StringUtils.isNotEmpty(cursor); return StringUtils.isEmpty(cursor);
} }
} }

View File

@@ -85,7 +85,7 @@ public class WxMsgService {
public void authorize(WxOAuth2UserInfo userInfo) { public void authorize(WxOAuth2UserInfo userInfo) {
User user = userDao.getByOpenId(userInfo.getOpenid()); User user = userDao.getByOpenId(userInfo.getOpenid());
//更新用户信息 //更新用户信息
if (StringUtils.isNotEmpty(user.getName())) { if (StringUtils.isEmpty(user.getName())) {
fillUserInfo(user.getId(), userInfo); fillUserInfo(user.getId(), userInfo);
} }
//触发用户登录成功操作 //触发用户登录成功操作

View File

@@ -17,7 +17,7 @@ public class HttpHeadersHandler extends ChannelInboundHandlerAdapter {
if (msg instanceof FullHttpRequest) { if (msg instanceof FullHttpRequest) {
HttpHeaders headers = ((FullHttpRequest) msg).headers(); HttpHeaders headers = ((FullHttpRequest) msg).headers();
String ip = headers.get("X-Real-IP"); String ip = headers.get("X-Real-IP");
if (StringUtils.isNotEmpty(ip)) {//如果没经过nginx就直接获取远端地址 if (StringUtils.isEmpty(ip)) {//如果没经过nginx就直接获取远端地址
InetSocketAddress address = (InetSocketAddress) ctx.channel().remoteAddress(); InetSocketAddress address = (InetSocketAddress) ctx.channel().remoteAddress();
ip = address.getAddress().getHostAddress(); ip = address.getAddress().getHostAddress();
} }