mirror of
https://github.com/cnlimiter/codex-register.git
synced 2026-09-05 15:36:52 +08:00
fix(tempmail): 先注释用户级API
This commit is contained in:
+16
-16
@@ -298,25 +298,25 @@ class TempMailService(BaseEmailService):
|
|||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
seen_mail_ids: set = set()
|
seen_mail_ids: set = set()
|
||||||
|
|
||||||
# 优先使用用户级 JWT,回退到 admin API
|
# 优先使用用户级 JWT,回退到 admin API 先注释用户级API
|
||||||
cached = self._email_cache.get(email, {})
|
# cached = self._email_cache.get(email, {})
|
||||||
jwt = cached.get("jwt")
|
# jwt = cached.get("jwt")
|
||||||
|
|
||||||
while time.time() - start_time < timeout:
|
while time.time() - start_time < timeout:
|
||||||
try:
|
try:
|
||||||
if jwt:
|
# if jwt:
|
||||||
response = self._make_request(
|
# response = self._make_request(
|
||||||
"GET",
|
# "GET",
|
||||||
"/user_api/mails",
|
# "/user_api/mails",
|
||||||
params={"limit": 20, "offset": 0},
|
# params={"limit": 20, "offset": 0},
|
||||||
headers={"x-user-token": jwt, "Content-Type": "application/json", "Accept": "application/json"},
|
# headers={"x-user-token": jwt, "Content-Type": "application/json", "Accept": "application/json"},
|
||||||
)
|
# )
|
||||||
else:
|
# else:
|
||||||
response = self._make_request(
|
response = self._make_request(
|
||||||
"GET",
|
"GET",
|
||||||
"/admin/mails",
|
"/admin/mails",
|
||||||
params={"limit": 20, "offset": 0, "address": email},
|
params={"limit": 20, "offset": 0, "address": email},
|
||||||
)
|
)
|
||||||
|
|
||||||
# /user_api/mails 和 /admin/mails 返回格式相同: {"results": [...], "total": N}
|
# /user_api/mails 和 /admin/mails 返回格式相同: {"results": [...], "total": N}
|
||||||
mails = response.get("results", [])
|
mails = response.get("results", [])
|
||||||
|
|||||||
Reference in New Issue
Block a user