diff --git a/VERSION b/VERSION index 0848465..0ca6e94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.31 +1.2.35 diff --git a/backend/app/routers/information.py b/backend/app/routers/information.py index b129c5d..7fb9484 100644 --- a/backend/app/routers/information.py +++ b/backend/app/routers/information.py @@ -454,6 +454,10 @@ def get_seek_match( if not info: raise HTTPException(status_code=404, detail="寻配号信息不存在") + # 更新用户配号(寻号)次数 + current_user.f99_96_search_count = (current_user.f99_96_search_count or 0) + 1 + db.commit() + # 获取用户所有藏品 collections = db.query(Collection).filter( Collection.f99_91_user_id == current_user.f99_90_id, diff --git a/backend/app/routers/ocr.py b/backend/app/routers/ocr.py index 29f8546..e9dffc1 100644 --- a/backend/app/routers/ocr.py +++ b/backend/app/routers/ocr.py @@ -113,6 +113,9 @@ async def recognize_image( # 生成OSS临时路径: temp/{year}/{month}/{day}/{uuid}.{ext} oss_key, temp_id = get_oss_path("temp", filename=image.filename) + # 初始化temp_path为空 + temp_path = None + # 上传到OSS try: image_url = upload_to_oss(image_data, oss_key) @@ -159,7 +162,7 @@ async def recognize_image( if response.status_code != 200: # 识别失败,删除临时文件 - if os.path.exists(temp_path): + if temp_path and os.path.exists(temp_path): os.remove(temp_path) raise HTTPException(status_code=500, detail=f"OCR API 调用失败:{response.text[:200]}") diff --git a/backend/app/services/sms.py b/backend/app/services/sms.py index d6953ca..f067142 100644 --- a/backend/app/services/sms.py +++ b/backend/app/services/sms.py @@ -8,10 +8,10 @@ from typing import Optional # 阿里云短信配置 SMS_CONFIG = { - "access_key_id": os.getenv("SMS_ACCESS_KEY_ID", "LTAI5t6HUnpFBLEK9194kPVG"), - "access_key_secret": os.getenv("SMS_ACCESS_KEY_SECRET", "LEr4Q8yRxb8D5b24cKfCwlt4MMoke1"), - "sign_name": "苏州算力", - "template_code": "SMS_501590956", + "access_key_id": os.getenv("SMS_ACCESS_KEY_ID", "LTAI5tQAx5niD7JQVqGE5acE"), + "access_key_secret": os.getenv("SMS_ACCESS_KEY_SECRET", "QsQFAEKBkaNynIoKyvdIi3BUyWVZu1"), + "sign_name": os.getenv("SMS_SIGN_NAME", "苏州算力"), + "template_code": os.getenv("SMS_TEMPLATE_CODE", "SMS_501590956"), } # 验证码缓存(生产环境建议用Redis) diff --git a/frontend/index.html b/frontend/index.html index 723723e..0ab0abb 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ -