Exemple #1
0
def infomation():
    api_key = request.args.get('key')
    pkgkey = None
    if api_key:
        pkgkey = Dsavailkey.query.filter_by(api_key=api_key).first()
    if pkgkey is None:
        resp = make_response('UnAuthorized Access', 401)
        resp.headers['WWW-Authenticate'] = 'Fail Authorization'
        return resp

    infos = _list_api_info()
    aaa = []
    for info in list(infos):
        aaa.append(info['ss'])
    ddd = "[" + ",".join(aaa) + "]"
    return Response(ddd, status=200, mimetype='application/json')
Exemple #2
0
def guide():
    api_key = request.args.get('key')
    pkgkey = None
    if api_key:
        pkgkey = Dsavailkey.query.filter_by(api_key=api_key).first()
    if pkgkey is None:
        resp = make_response('UnAuthorized Access', 401)
        resp.headers['WWW-Authenticate'] = 'Fail Authorization'
        return resp

    infos = _list_api_info()
    aaa = []
    for info in list(infos):
        aaa.append(info['ss'])
    # ddd = "[" + ",".join(aaa) + "]"
    apis = json.loads("[" + ",".join(aaa) + "]")
    return render_template('api.html', apis=apis)