Compare commits
2 commits
9dec6938dd
...
94d4e16cfd
Author | SHA1 | Date | |
---|---|---|---|
94d4e16cfd | |||
c1e9ca4878 |
2 changed files with 14 additions and 4 deletions
|
@ -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()
|
10
resource/verify.html
Normal file
10
resource/verify.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Verify</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>だめです</h1>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue