feat(chat、pay): 增加pay沙盒、移除杂项
This commit is contained in:
26
core/app.py
26
core/app.py
@@ -41,10 +41,6 @@ def create_app() -> FastAPI:
|
||||
for router in routers:
|
||||
app.include_router(router)
|
||||
|
||||
if settings.ENVIRONMENT != 'prod':
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
app.mount("/uploads", StaticFiles(directory="uploads"), name="uploads")
|
||||
|
||||
@app.on_event('startup')
|
||||
async def startup_event():
|
||||
redis_conn = await get_cache()
|
||||
@@ -80,16 +76,16 @@ def create_app() -> FastAPI:
|
||||
}
|
||||
)
|
||||
|
||||
# @app.exception_handler(Exception)
|
||||
# async def http_exception_handler(request: Request, exc: Exception):
|
||||
# await exception_log(request, exc)
|
||||
# return UJSONResponse(
|
||||
# status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
# content={
|
||||
# 'status': status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
# 'data': None,
|
||||
# 'message': 'Internal server error'
|
||||
# }
|
||||
# )
|
||||
@app.exception_handler(Exception)
|
||||
async def http_exception_handler(request: Request, exc: Exception):
|
||||
await exception_log(request, exc)
|
||||
return UJSONResponse(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
content={
|
||||
'status': status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
'data': None,
|
||||
'message': 'Internal server error'
|
||||
}
|
||||
)
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user