生成IP库的时候自动指定省略的城市名

This commit is contained in:
GoEdgeLab
2023-07-12 15:34:40 +08:00
parent 3387216225
commit 9079f8d5d8

View File

@@ -70,6 +70,11 @@ func (this *Template) Extract(text string, emptyValues []string) (values map[str
}
}
// 自动修复省略的城市名
if len(values["city"]) == 0 && len(values["province"]) > 0 && len(values["town"]) > 0 {
values["city"] = values["province"]
}
ok = true
return
}