This commit is contained in:
aaron 2025-02-27 11:00:51 +08:00
parent 562d931548
commit b0e17358f3
3 changed files with 5 additions and 3 deletions

View File

@ -88,7 +88,7 @@ async def handle_server(request: Request):
except Exception as e:
logging.exception("处理微信消息异常")
# 返回空字符串表示接收成功
return Response(content="", media_type="text/plain")
raise e

View File

@ -57,7 +57,7 @@ def decrypt_msg(msg_encrypt: str, signature: str, timestamp: str, nonce: str) ->
logging.exception("解密企业微信消息失败")
return None
@router.get("/callback")
@router.get("")
async def verify_callback(
msg_signature: str = Query(..., description="签名"),
timestamp: str = Query(..., description="时间戳"),
@ -77,7 +77,7 @@ async def verify_callback(
logging.exception("验证回调配置失败")
return Response(status_code=403)
@router.post("/callback")
@router.post("")
async def wechat_corp_callback(
request: Request,
msg_signature: str = Query(..., description="签名"),

View File

@ -11,6 +11,7 @@ from app.core.response import CustomJSONResponse
import logging
from app.core.config import settings
from app.core.wecombot import WecomBot
from app.api.endpoints import wecom
# 创建数据库表
Base.metadata.create_all(bind=engine)
@ -38,6 +39,7 @@ app.add_middleware(RequestLoggerMiddleware)
app.include_router(dashboard.router, prefix="/api/dashboard", tags=["仪表盘"])
app.include_router(wechat.router,prefix="/api/wechat",tags=["微信"])
app.include_router(mp.router, prefix="/api/mp", tags=["微信公众号"])
app.include_router(wecom.router, prefix="/api/wecom", tags=["企业微信"])
app.include_router(user.router, prefix="/api/user", tags=["用户"])
app.include_router(bank_card.router, prefix="/api/bank-cards", tags=["用户银行卡"])
app.include_router(withdraw.router, prefix="/api/withdraw", tags=["提现"])