From 23616afd16c2ff6dcd0b41cb79408610f75dd67a Mon Sep 17 00:00:00 2001 From: dockermen Date: Tue, 8 Apr 2025 14:07:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E8=B7=AF=E5=BE=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/config.cpython-38.pyc | Bin 0 -> 120 bytes config.py | 2 ++ main.py | 12 +++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 __pycache__/config.cpython-38.pyc create mode 100644 config.py diff --git a/__pycache__/config.cpython-38.pyc b/__pycache__/config.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9bf17eeab5a0625905dd35f0a478f89b67aaaec GIT binary patch literal 120 zcmWIL<>g`k0@v+d(s_aOV-N=!FakLaKwQiLBvKfn7*ZI688n$f{4^PFvAVcAg}Sd~ wC}IN2fr(!t`sMjW*~JBk$*KCu`FUxX>3Ri~w>WHa^HWN5Qtd#deFkC%0GuNjUjP6A literal 0 HcmV?d00001 diff --git a/config.py b/config.py new file mode 100644 index 0000000..3aee388 --- /dev/null +++ b/config.py @@ -0,0 +1,2 @@ +DEBUG= True + diff --git a/main.py b/main.py index 95e7c46..132bdcf 100644 --- a/main.py +++ b/main.py @@ -1,16 +1,26 @@ import os import requests from flask import Flask, render_template, request, redirect, url_for, session +from werkzeug.routing import BaseConverter app = Flask(__name__) +class PhoneConverter(BaseConverter): + regex = '1[3-9]\d{9}' + +app.url_map.converters["phone"] = PhoneConverter + @app.route("/", methods=["GET", "POST"]) def index(): - return render_template("index.html") +@app.route("/") +def phone(param): + return param + if __name__ == "__main__": + app.config.from_pyfile("config.py") app.run(host="0.0.0.0") \ No newline at end of file