优化代码

This commit is contained in:
GoEdgeLab
2022-09-23 11:09:21 +08:00
parent 6bd2ac0d2b
commit 2c0a13698f
18 changed files with 30 additions and 23 deletions

View File

@@ -80,9 +80,9 @@ func (this *UpdateIPPopupAction) RunPost(params struct {
var ipToLong uint64
if len(params.IpTo) > 0 && !utils.IsIPv4(params.IpTo) {
ipToLong = utils.IP2Long(params.IpTo)
this.Fail("请输入正确的结束IP")
}
ipToLong = utils.IP2Long(params.IpTo)
if ipFromLong > 0 && ipToLong > 0 && ipFromLong > ipToLong {
params.IpTo, params.IpFrom = params.IpFrom, params.IpTo