Browse Source

调整模板接口v2body为空时报错

baoyubo 10 months ago
parent
commit
d866253521
1 changed files with 3 additions and 2 deletions
  1. 3 2
      routers/api/gateway/__init__.py

+ 3 - 2
routers/api/gateway/__init__.py

@@ -680,12 +680,13 @@ async def v2(serviceid:str,request: Request, db: Session = Depends(get_db)):
     # print(query_list)
     data = await request.body()
     body = data.decode(encoding='utf-8')
+    size = 10
+    current = 1
     if len(body) > 0:
         body = json.loads(body)
 
         # 分页器 页数和页码的设置
-        size = 10
-        current = 1
+
         if "size" in body:
             if isinstance(body['size'], str):
                 size = int(body['size'])