refactor:修改pydantic数据校验模型名

This commit is contained in:
zhengxinonly
2022-07-04 20:56:24 +08:00
parent 45874b17ee
commit ad0f174996
8 changed files with 14 additions and 57 deletions
-2
View File
@@ -1,5 +1,3 @@
from flask import Blueprint
from common import register_api
from .file import FilePhotoAPI
from .passport import LoginAPI
+2 -2
View File
@@ -11,7 +11,7 @@ from common.utils.rights import record_logging
from models import UserModel
class LoginModel(BaseModel):
class LoginSchema(BaseModel):
username: str
password: str
captcha: str
@@ -25,7 +25,7 @@ class LoginAPI(MethodView):
return make_response(render_template('index/login.html'))
@validate()
def post(self, body: LoginModel):
def post(self, body: LoginSchema):
s_code = session.get("code", None)
session["code"] = None