Optimized the problem of requesting regional restriction matching errors

This commit is contained in:
风起
2024-06-18 20:33:35 +08:00
parent febd771e03
commit fde5465503
2 changed files with 98 additions and 92 deletions
+4
View File
@@ -1,3 +1,7 @@
## [24.06.18.2001] - 2024-06-18
### Update
- Optimized the problem of requesting regional restriction matching errors
## [23.08.21.0113] - 2023-08-21
### Added
- Custom Delete Response Fields
+4 -2
View File
@@ -83,8 +83,10 @@ func IPLookUp(location, ip string) (state bool) {
_ = json.Indent(&prettyJSON, []byte(IPLook.body), "", "\t")
logger.Emergency(string(prettyJSON.Bytes()))
// Check whether the IP address is the same as the specified location
if strings.Contains(strings.ToLower(IPLook.location), strings.ToLower(location)) {
return true // The query result is true
for _, location := range strings.Split(location, ",") {
if strings.Contains(strings.ToLower(IPLook.location), strings.ToLower(location)) {
return true // The query result is true
}
}
}
}