diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index 9d3a6b7..1569221 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -144,9 +144,9 @@ func (this *HTTPRequest) Do() { return } - // 带宽限制 - if this.Server.BandwidthLimit != nil && this.Server.BandwidthLimit.IsOn && !this.Server.BandwidthLimit.IsEmpty() && this.Server.BandwidthLimitStatus != nil && this.Server.BandwidthLimitStatus.IsValid() { - this.doBandwidthLimit() + // 流量限制 + if this.Server.TrafficLimit != nil && this.Server.TrafficLimit.IsOn && !this.Server.TrafficLimit.IsEmpty() && this.Server.TrafficLimitStatus != nil && this.Server.TrafficLimitStatus.IsValid() { + this.doTrafficLimit() this.doEnd() return } diff --git a/internal/nodes/http_request_plan_expires.go b/internal/nodes/http_request_plan_expires.go index 622dd22..45e1184 100644 --- a/internal/nodes/http_request_plan_expires.go +++ b/internal/nodes/http_request_plan_expires.go @@ -7,7 +7,7 @@ import ( "net/http" ) -// 带宽限制 +// 套餐过期 func (this *HTTPRequest) doPlanExpires() { this.tags = append(this.tags, "plan") diff --git a/internal/nodes/http_request_bandwidth_limit.go b/internal/nodes/http_request_traffic_limit.go similarity index 68% rename from internal/nodes/http_request_bandwidth_limit.go rename to internal/nodes/http_request_traffic_limit.go index 979bf8c..08663b5 100644 --- a/internal/nodes/http_request_bandwidth_limit.go +++ b/internal/nodes/http_request_traffic_limit.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" ) -// 带宽限制 -func (this *HTTPRequest) doBandwidthLimit() { - var config = this.Server.BandwidthLimit +// 流量限制 +func (this *HTTPRequest) doTrafficLimit() { + var config = this.Server.TrafficLimit this.tags = append(this.tags, "bandwidth") @@ -19,6 +19,6 @@ func (this *HTTPRequest) doBandwidthLimit() { if len(config.NoticePageBody) != 0 { _, _ = this.writer.WriteString(config.NoticePageBody) } else { - _, _ = this.writer.WriteString(serverconfigs.DefaultBandwidthLimitNoticePageBody) + _, _ = this.writer.WriteString(serverconfigs.DefaultTrafficLimitNoticePageBody) } }