优化WAF区域/省份封禁:增加仅允许、增加中国香港澳台、内地等特殊区域

This commit is contained in:
刘祥超
2023-07-07 09:53:00 +08:00
parent fc749b6ef8
commit ca2b1a6612
30 changed files with 751 additions and 237 deletions

View File

@@ -4,13 +4,12 @@ import (
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/regionconfigs"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/lists"
"github.com/iwind/TeaGo/maps"
)
const ChinaCountryId = 1
type SelectProvincesPopupAction struct {
actionutils.ParentAction
}
@@ -24,7 +23,7 @@ func (this *SelectProvincesPopupAction) RunGet(params struct {
}) {
var selectedProvinceIds = utils.SplitNumbers(params.ProvinceIds)
provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithRegionCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithRegionCountryIdRequest{RegionCountryId: ChinaCountryId})
provincesResp, err := this.RPC().RegionProvinceRPC().FindAllRegionProvincesWithRegionCountryId(this.AdminContext(), &pb.FindAllRegionProvincesWithRegionCountryIdRequest{RegionCountryId: regionconfigs.RegionChinaId})
if err != nil {
this.ErrorPage(err)
return