feat:m-team x-api-key

This commit is contained in:
jxxghp
2024-03-24 13:38:36 +08:00
parent 96de772119
commit bd7ca7fa60
7 changed files with 119 additions and 13 deletions

View File

@ -282,6 +282,18 @@ class StringUtils:
return netloc[-2]
return netloc[0]
@staticmethod
def get_url_host(url: str) -> str:
"""
获取URL的一级域名
"""
if not url:
return ""
_, netloc = StringUtils.get_url_netloc(url)
if not netloc:
return ""
return netloc.split(".")[-2]
@staticmethod
def get_base_url(url: str) -> str:
"""