From 0f21c030031d2f6207ef0dacb9c0da6483523d4d Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Mon, 10 Jun 2024 13:34:22 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9E=E3=82=B9=E3=82=BF=E3=83=BC=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=83=AF=E3=83=BC=E3=83=89=E3=81=AE=E7=85=A7=E5=90=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker_client.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dislocker_client.py b/dislocker_client.py index aec99a4..26eb9fc 100644 --- a/dislocker_client.py +++ b/dislocker_client.py @@ -103,12 +103,26 @@ class Lock(customtkinter.CTkToplevel): "pc_number": int(client_config["pc_number"]), "password": self.hash_genarate(str(self.password_entry.get())) } - responce = requests.post(auth_url, json=auth_json) + try: + responce = requests.post(auth_url, json=auth_json) + except: + master_password_hash = self.hash_genarate(str(self.password_entry.get())) + if client_config["master_password_hash"] == master_password_hash: + self.destroy() + app.exit() + else: + self.msg_subtitle_1.configure(text='サインインするには、パスワードが必要です。\nネットワークエラーが発生しています。\n続行するには、マスターパスワードを入力して下さい。') + if responce.status_code == 200: self.destroy() app.exit() else: - self.msg_subtitle_1.configure(text='サインインするには、パスワードが必要です。\nパスワードが違います!') + master_password_hash = self.hash_genarate(str(self.password_entry.get())) + if client_config["master_password_hash"] == master_password_hash: + self.destroy() + app.exit() + else: + self.msg_subtitle_1.configure(text='サインインするには、パスワードが必要です。\nパスワードが違います!') def handler_close(self): pass