這是我的功能看起來怎麼樣:瓶智威湯遜 - 試圖訪問時,獲得404/AUTH
# authenticate a user
def authenticate(username, password):
userAuth = username_mapping.get(username, None)
if userAuth and userAuth.password == password:
return userAuth
# identify user from a token
def identity(payload):
user_id = payload['identity']
return userid_mapping.get(user_id, None)
但是,當我嘗試張貼一些JSON數據給它,它給了我下面的錯誤:
Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
可能是什麼問題?
你是怎麼定義'@ app.route'和你用什麼網址來做這個帖子的? –
我把'@jwt_required()'放在我的'get'方法上面,並且使用url http:// 127.0.0.1/auth' – gambit2017