feat(gateway): 接入接口22与账号鉴权测试页
This commit is contained in:
@@ -250,6 +250,7 @@ async def index():
|
||||
"test_pages": {
|
||||
"if1_measure": "/static/test_interface1.html",
|
||||
"if2_hair_grow": "/static/test_interface2.html",
|
||||
"if22_hair_grow": "/static/test_interface22.html",
|
||||
"if3_hair_grow_b": "/static/test_interface3.html",
|
||||
"if4_features": "/static/test_interface4.html",
|
||||
"if42_features": "/static/test_interface42.html",
|
||||
@@ -581,6 +582,14 @@ async def hair_grow(request: Request):
|
||||
return await _proxy(request, "/api/v1/hair/grow")
|
||||
|
||||
|
||||
@app.post("/api/v1/hair/grow-22", summary="接口22:生发密度与发际线高度", tags=["生发"])
|
||||
async def hair_grow_22(request: Request, auth_error=Depends(client_auth_error)):
|
||||
"""鉴权后透传图片、发型、可重复的 hair_density 和 hairline_height 至 GPU Worker。"""
|
||||
if auth_error is not None:
|
||||
return auth_error
|
||||
return await _proxy(request, "/api/v1/hair/grow-22")
|
||||
|
||||
|
||||
@app.post("/api/v1/hair/grow-b", tags=["生发"], deprecated=True)
|
||||
async def hair_grow_b(request: Request):
|
||||
"""接口3:B端生发(已屏蔽)"""
|
||||
|
||||
@@ -149,7 +149,7 @@ async def client_auth_error(credentials: HTTPAuthorizationCredentials | None = S
|
||||
|
||||
@router.get("/check", summary="验证当前访问令牌")
|
||||
async def check(auth_error=Depends(client_auth_error)):
|
||||
"""检查与 42、52、72 相同的 Bearer 令牌,无需提交图片。"""
|
||||
"""检查受保护业务接口使用的 Bearer 令牌。"""
|
||||
if auth_error is not None:
|
||||
return auth_error
|
||||
return _response(0, "访问令牌有效")
|
||||
|
||||
Reference in New Issue
Block a user