|
@@ -220,7 +220,8 @@ async def getSiZhuInfo(request: SiZhuInfoRequest):
|
|
|
@app.post("/api/customLogin")
|
|
|
async def customLogin(request: CustomLogin):
|
|
|
logging.info("login")
|
|
|
- dt = CustomUser.select().where(CustomUser.user == request.user, CustomUser.psd == request.psd).first()
|
|
|
+ dt = CustomUser.select().where(CustomUser.user == request.user,
|
|
|
+ CustomUser.psd == request.psd).first()
|
|
|
|
|
|
if dt is not None:
|
|
|
return {"msg": "ok", "name": dt.name, "sexy": dt.sexy}
|
|
@@ -312,3 +313,10 @@ async def test(request: Request):
|
|
|
content["db"] = "broke , reconnect"
|
|
|
logging.info("reconnect database")
|
|
|
return JSONResponse(content=content, headers=headers)
|
|
|
+
|
|
|
+
|
|
|
+@app.get("/api/test2")
|
|
|
+async def test2():
|
|
|
+ users = UserInfo.select().where(UserInfo.customer != None)
|
|
|
+ users = [__build_user_object(dt) for dt in users]
|
|
|
+ return {"message": "Hello World", "users": users}
|