mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-03-15 17:45:37 +08:00
优化代码
This commit is contained in:
@@ -109,6 +109,10 @@ func (this *SettingAction) RunPost(params struct {
|
||||
FollowRedirects: reverseProxyConfig.FollowRedirects,
|
||||
ProxyProtocolJSON: proxyProtocolJSON,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -24,5 +24,4 @@ func (this *IndexAction) RunGet(params struct {
|
||||
} else {
|
||||
this.RedirectURL("/servers/groups/group/settings/httpReverseProxy?groupId=" + types.String(params.GroupId))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -109,6 +109,10 @@ func (this *SettingAction) RunPost(params struct {
|
||||
FollowRedirects: reverseProxyConfig.FollowRedirects,
|
||||
ProxyProtocolJSON: proxyProtocolJSON,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -96,8 +96,12 @@ func (this *SettingAction) RunPost(params struct {
|
||||
StripPrefix: reverseProxyConfig.StripPrefix,
|
||||
AutoFlush: reverseProxyConfig.AutoFlush,
|
||||
AddHeaders: reverseProxyConfig.AddHeaders,
|
||||
FollowRedirects: reverseProxyConfig.FollowRedirects,
|
||||
FollowRedirects: reverseProxyConfig.FollowRedirects,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -79,9 +79,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
|
||||
|
||||
Reference in New Issue
Block a user