diff --git a/app/__pycache__/main.cpython-310.pyc b/app/__pycache__/main.cpython-310.pyc index 231c244..bc46df3 100644 Binary files a/app/__pycache__/main.cpython-310.pyc and b/app/__pycache__/main.cpython-310.pyc differ diff --git a/app/main.py b/app/main.py index 9a35a80..3969f5c 100644 --- a/app/main.py +++ b/app/main.py @@ -12,7 +12,7 @@ import qrcode import os from fastapi.responses import FileResponse from fastapi.staticfiles import StaticFiles -from app.tgMessage import sendTg # type: ignore #发送tg消息 +from app import tgMessage # type: ignore #发送tg消息 from datetime import datetime # 初始化数据库 @@ -59,7 +59,7 @@ def hello(): @app.get("/tgMessage") -def tgMessage(openid: Optional[str] = None, db: Session = Depends(get_db)): +def tgMessagefun(openid: Optional[str] = None, db: Session = Depends(get_db)): current_time = datetime.now() print("Current Date and Time:", current_time) # 发送tg消息通知 wxid_4413224132412 || o7LFAwR32hWGq9XOpd7ZxK1wZxq8 @@ -78,11 +78,11 @@ def tgMessage(openid: Optional[str] = None, db: Session = Depends(get_db)): # message = f"{userInfo['nickname']}/{userInfo['gender']}在{current_time}进行了访问" message = f"{userInfo.nickname}/{userInfo.gender}在{current_time}进行了访问" - sendTg(message) + tgMessage.sendTg(message) else: print('openid未关联') message = f'openid: {openid}-未关联,在{current_time}访问网页' - sendTg(message) + tgMessage.sendTg(message) def create_user_task(db: Session, user: schemas.UserCreate):