Spaces:
Running
Running
修复购买问题
Browse files
app.py
CHANGED
|
@@ -398,14 +398,6 @@ def validate_resource(req_data: ValidateResourceRequest, sql_db: Session = Depen
|
|
| 398 |
|
| 399 |
if not item: return JSONResponse(content={"error": "资源不存在或已被删除"}, status_code=404)
|
| 400 |
|
| 401 |
-
price = int(item.get("price", 0))
|
| 402 |
-
author = item.get("author")
|
| 403 |
-
|
| 404 |
-
if price > 0 and req_data.account != author:
|
| 405 |
-
owned = sql_db.query(Ownership).filter(Ownership.account == req_data.account, Ownership.item_id == req_data.item_id).first()
|
| 406 |
-
if not owned:
|
| 407 |
-
return JSONResponse(content={"error": "🚨 非法下载:云端数据库未找到您的购买凭证!"}, status_code=403)
|
| 408 |
-
|
| 409 |
# 内部代理URL直接返回成功(文件已存在于服务器本地)
|
| 410 |
if target_url.startswith("https://zhiwei666-comfyui-ranking-api.hf.space/api/image_proxy"):
|
| 411 |
return {"status": "success", "message": "资源有效"}
|
|
|
|
| 398 |
|
| 399 |
if not item: return JSONResponse(content={"error": "资源不存在或已被删除"}, status_code=404)
|
| 400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 401 |
# 内部代理URL直接返回成功(文件已存在于服务器本地)
|
| 402 |
if target_url.startswith("https://zhiwei666-comfyui-ranking-api.hf.space/api/image_proxy"):
|
| 403 |
return {"status": "success", "message": "资源有效"}
|