update
This commit is contained in:
parent
944644e371
commit
6475a3298b
@ -172,6 +172,8 @@ async def phone_login(
|
|||||||
response: Response = None
|
response: Response = None
|
||||||
):
|
):
|
||||||
""" 手机号登录(测试环境) """
|
""" 手机号登录(测试环境) """
|
||||||
|
if not settings.DEBUG:
|
||||||
|
return error_response(code=400, message="测试环境不支持手机号登录")
|
||||||
|
|
||||||
# 查找或创建用户
|
# 查找或创建用户
|
||||||
user = db.query(UserDB).filter(UserDB.phone == request.phone).first()
|
user = db.query(UserDB).filter(UserDB.phone == request.phone).first()
|
||||||
|
|||||||
@ -148,6 +148,11 @@ async def wechat_corp_callback(
|
|||||||
class RefreshRequest(BaseModel):
|
class RefreshRequest(BaseModel):
|
||||||
code: str
|
code: str
|
||||||
|
|
||||||
|
@router.get("/access_token")
|
||||||
|
async def get_access_token():
|
||||||
|
access_token = await wecom_client.get_access_token()
|
||||||
|
return success_response(message="获取企业微信access_token成功", data=access_token)
|
||||||
|
|
||||||
@router.post("/refresh")
|
@router.post("/refresh")
|
||||||
async def refresh(
|
async def refresh(
|
||||||
request: RefreshRequest,
|
request: RefreshRequest,
|
||||||
|
|||||||
@ -19,7 +19,9 @@ Base.metadata.create_all(bind=engine)
|
|||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="Beefast 蜂快到家",
|
title="Beefast 蜂快到家",
|
||||||
description="API 文档",
|
description="API 文档",
|
||||||
version="1.0.0")
|
version="1.0.0",
|
||||||
|
docs_url="/api/docs" if not settings.DEBUG else None
|
||||||
|
)
|
||||||
|
|
||||||
app.default_response_class = CustomJSONResponse
|
app.default_response_class = CustomJSONResponse
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user