Update server.py
Browse files
server.py
CHANGED
|
@@ -288,19 +288,18 @@ def check_api1():
|
|
| 288 |
if Service_status:
|
| 289 |
print("结束检测")
|
| 290 |
break
|
| 291 |
-
url = f"{st_url}
|
| 292 |
try:
|
| 293 |
response = requests_retry_session().get(url, timeout=30)
|
| 294 |
response.raise_for_status() # 检查响应状态
|
| 295 |
-
#
|
| 296 |
-
|
| 297 |
-
print("接口返回信息:",
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
print("检测到注册账号相关信息,结束检测")
|
| 301 |
break # 跳出循环
|
| 302 |
else:
|
| 303 |
-
print("接口返回信息:",
|
| 304 |
|
| 305 |
# except requests.exceptions.HTTPError as e:
|
| 306 |
# if e.response.status_code == 403:
|
|
|
|
| 288 |
if Service_status:
|
| 289 |
print("结束检测")
|
| 290 |
break
|
| 291 |
+
url = f"{st_url}//csrf-token" # 确保这个 URL 是正确的
|
| 292 |
try:
|
| 293 |
response = requests_retry_session().get(url, timeout=30)
|
| 294 |
response.raise_for_status() # 检查响应状态
|
| 295 |
+
# 尝试解析 JSON 响应
|
| 296 |
+
response_json = response.json() # 获取 JSON 内容
|
| 297 |
+
print("接口返回信息:", response_json)
|
| 298 |
+
if "token" in response_json:
|
| 299 |
+
print("检测到 token,结束检测")
|
|
|
|
| 300 |
break # 跳出循环
|
| 301 |
else:
|
| 302 |
+
print("接口返回信息:", response_json)
|
| 303 |
|
| 304 |
# except requests.exceptions.HTTPError as e:
|
| 305 |
# if e.response.status_code == 403:
|