端口映射配置优化,不配置时,默认为127.0.0.1
This commit is contained in:
@@ -293,7 +293,7 @@
|
||||
licenseId: undefined,
|
||||
licenseName: undefined,
|
||||
serverPort: undefined,
|
||||
clientIp: undefined,
|
||||
clientIp: '127.0.0.1',
|
||||
clientPort: undefined
|
||||
}
|
||||
},
|
||||
|
||||
+5
-1
@@ -6,6 +6,7 @@ import fun.asgc.neutrino.proxy.server.controller.req.*;
|
||||
import fun.asgc.neutrino.proxy.server.controller.res.*;
|
||||
import fun.asgc.neutrino.proxy.server.service.PortMappingService;
|
||||
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.noear.solon.annotation.*;
|
||||
|
||||
/**
|
||||
@@ -33,8 +34,11 @@ public class PortMappingController {
|
||||
ParamCheckUtil.checkNotNull(req, "req");
|
||||
ParamCheckUtil.checkNotNull(req.getLicenseId(), "licenseId");
|
||||
ParamCheckUtil.checkNotNull(req.getServerPort(), "serverPort");
|
||||
ParamCheckUtil.checkNotEmpty(req.getClientIp(), "clientIp");
|
||||
ParamCheckUtil.checkNotNull(req.getClientPort(), "clientPort");
|
||||
if (StringUtils.isBlank(req.getClientIp())) {
|
||||
// 没传客户端ip,默认为127.0.0.1
|
||||
req.setClientIp("127.0.0.1");
|
||||
}
|
||||
|
||||
return portMappingService.create(req);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user