mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-30 15:16:45 +08:00
RAGFlow CLI: ping server before input password when login user (#12791)
### What problem does this PR solve? As title ### Type of change - [x] Refactoring --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@ -50,6 +50,18 @@ class RAGFlowClient:
|
||||
self.server_type = server_type
|
||||
|
||||
def login_user(self, command):
|
||||
try:
|
||||
response = self.http_client.request("GET", "/system/ping", use_api_base=False, auth_kind="web")
|
||||
if response.status_code == 200 and response.content == b"pong":
|
||||
pass
|
||||
else:
|
||||
print("Server is down")
|
||||
return
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
print("Can't access server for login (connection failed)")
|
||||
return
|
||||
|
||||
email : str = command["email"]
|
||||
user_password = getpass.getpass(f"password for {email}: ").strip()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user