mirror of
https://github.com/Kakune55/PyGetGPT.git
synced 2025-12-14 08:13:55 +08:00
完成创建密钥功能
This commit is contained in:
11
main.py
11
main.py
@@ -83,10 +83,17 @@ def adminList():
|
||||
return flask.render_template("keylist.html",data=data)
|
||||
return "未登录 "
|
||||
|
||||
@app.route('/admin/createkey')
|
||||
@app.route('/admin/createkey', methods=['POST','GET'])
|
||||
def createkey():
|
||||
if "admin" in flask.session :
|
||||
return flask.render_template("createKey.html")
|
||||
if flask.request.method == "GET":
|
||||
return flask.render_template("createKey.html",resq="null")
|
||||
if "number" in flask.request.form: # 创建单个还是多个
|
||||
resq = db.createKey(flask.request.form["quota"], flask.request.form["number"])
|
||||
elif "key" in flask.request.form:
|
||||
resq = db.createKey(flask.request.form["quota"],1,flask.request.form["key"])
|
||||
|
||||
return flask.render_template("createKey.html",resq=resq)
|
||||
return "未登录 "
|
||||
|
||||
@app.route('/admin/operate', methods=['POST','GET'])
|
||||
|
||||
Reference in New Issue
Block a user