fix m-team api path

This commit is contained in:
jxxghp
2024-06-19 14:16:20 +08:00
parent 9cf240b8e8
commit 681f1eaeb5
2 changed files with 9 additions and 6 deletions

View File

@ -107,7 +107,8 @@ class SiteChain(ChainBase):
判断站点是否已经登陆m-team
"""
user_agent = site.ua or settings.USER_AGENT
url = f"{site.url}api/member/profile"
domain = StringUtils.get_url_domain(site.url)
url = f"https://api.{domain}/api/member/profile"
headers = {
"Content-Type": "application/json",
"User-Agent": user_agent,
@ -127,7 +128,7 @@ class SiteChain(ChainBase):
timeout=site.timeout or 15,
proxies=settings.PROXY if site.proxy else None,
referer=f"{site.url}index"
).post_res(url=urljoin(url, "api/member/updateLastBrowse"))
).post_res(url=f"https://api.{domain}/api/member/updateLastBrowse")
if res:
return True, "连接成功"
else: