mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 06:03:42 +08:00
[fix] String类型判断使用StringUtils.isNotEmpty() 而不是Objects.isNull()
This commit is contained in:
@@ -34,6 +34,6 @@ public class CursorPageBaseReq {
|
|||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Boolean isFirstPage() {
|
public Boolean isFirstPage() {
|
||||||
return StringUtils.isNotEmpty(cursor);
|
return StringUtils.isEmpty(cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
//触发用户登录成功操作
|
//触发用户登录成功操作
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user