优化代码

This commit is contained in:
GoEdgeLab
2022-08-21 20:47:29 +08:00
parent 02bbf3ec89
commit 0f5c901f11
9 changed files with 48 additions and 21 deletions

View File

@@ -93,8 +93,16 @@ func (this *ViewPopupAction) RunGet(params struct {
}
region := regionResp.IpRegion
if region != nil {
var regionName = region.Summary
// remove isp from regionName
var index = strings.LastIndex(regionName, "|")
if index > 0 {
regionName = regionName[:index]
}
regionMap = maps.Map{
"full": region.Summary,
"full": regionName,
"isp": region.Isp,
}
}