🐞 fix: 修复bug

This commit is contained in:
AdminWhaleFall
2022-04-16 23:32:49 +08:00
parent c37bb15737
commit 15be73b457
8 changed files with 172 additions and 79 deletions

View File

@@ -1,9 +1,25 @@
# encoding=utf8
# flask app views
from . import main
import json
from ..model import Apis, API
from ..utils import test_resq
from flask_app import db
from flask import request, jsonify
@main.route("/",methods=['GET','POST'])
@main.route("/", methods=['GET', 'POST'])
def index():
return "index"
@main.route("/testapi/", methods=['GET', 'POST'])
def testapi():
try:
req = request.json
api = API(**req)
resp = test_resq(api, phone=req.get('phone'))
print(resp.text)
return jsonify({"status": 0, "resp": resp.text})
except Exception as why:
return jsonify({"status": 1, "resp": why})