我想从 URL 中获取参数“组织”到我的 flask-httpauth 密码验证功能中。到目前为止,我可以将值放入我的正常功能中:
@app.route('/api/<organisation>/admin/todo', methods=['GET'])
@auth_admin.login_required
def get_admin_todo(organisation):
return jsonify({'organisation': organisation})
但我无法将其放入身份验证功能:
@auth_admin.get_password
def get_password_admin(username):
organisation = "" #here I would like to have my organisation value
password = "my pwd"
return password
但是我需要这个参数来识别。我想通过他的组织、用户名和密码来识别一个人。如果有人有任何想法,我会很高兴。
非常感谢你
蛇