From 94d4e16cfdac394d33956c53f7021e7048dd281a Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Sat, 8 Jun 2024 20:26:26 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=BF=9C=E3=83=80=E3=83=9F=E3=83=BC?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E8=BF=94=E3=81=99=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dislocker_auth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dislocker_auth.py b/dislocker_auth.py index 0644e5a..0f28ec4 100644 --- a/dislocker_auth.py +++ b/dislocker_auth.py @@ -1,7 +1,7 @@ import psycopg2 import os import json -from flask import Flask, request, jsonify +from flask import Flask, request, jsonify, render_template config_dir_path = "./config/" db_config_path = config_dir_path + "db.json" @@ -41,7 +41,7 @@ class Auth(): self.db.commit() -app = Flask(__name__) +app = Flask(__name__, static_folder="./resource/") auth = Auth(db_config["host"], db_config["db"], db_config["port"], db_config["username"], db_config["password"]) @app.route('/verify', methods=['POST']) @@ -51,9 +51,9 @@ def verify(): if auth.check(pc_number, password) == 0: auth.delete(pc_number) - return jsonify({'message': 'ok'}), 200 + return render_template("verify.html"), jsonify({'message': 'ok'}), 200 else: - return jsonify({'message': 'damedesu'}), 401 + return render_template("verify.html"), jsonify({'message': 'damedesu'}), 401 if __name__ == '__main__': app.run() \ No newline at end of file