from fastapi import FastAPI
import uvicorn
app = FastAPI()
#仅支持POST
@app.post("/login1")
def login():
return {"msg: login success1"}
#支持POST, GET,PUT
@app.api_route("/login",methods=("GET","POST","PUT"))
def login():
return {"msg: login success2"}
if __name__ == '__main__':
uvicorn.run(app)