假设我有这条路线:
app.add_url_rule('/',
view_func=index,
methods=['GET'])
app.add_url_rule('login',
view_func=login,
methods=['GET', 'POST'])
@validate_access()
def index():
#......
@validate_access()
def login():
#......
Run Code Online (Sandbox Code Playgroud)
我有2个端点与相同的装饰"@validate_access".当我运行这个代码时,我得到了
AssertionError: View function mapping is overwriting an existing endpoint function: wrapperAssertionError: View function mapping is overwriting an existing endpoint function: wrapper
Run Code Online (Sandbox Code Playgroud)
我不知道它是不是一个bug.但如果有解决方案,请通知我.
谢谢 :)