这是我的例子:
from flask import Flask
app = Flask(__name__)
def add1(f):
def inner(*args, **kwargs):
return str(f(*args, **kwargs))+'1'
return inner
@app.route('/')
@add1
def hello1():
return "hello1";
@app.route('/hello2')
@add1
def hello2():
return "hello2";
if(__name__ =='__main__'):
app.run()
当我运行 127.0.0.1:5000 时,我希望得到“hello11”,但我得到“hello21”,为什么?