Ver Fonte

获取p2p类型

locky há 2 anos atrás
pai
commit
bbbc271481
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      Controller/SerialNumberController.py

+ 4 - 1
Controller/SerialNumberController.py

@@ -134,9 +134,12 @@ class SerialNumberView(View):
                 if region_id not in REGION_ID_LIST:
                     return response.json(444, {'invalid region_id': region_id})
 
-                p2p_type = request_dict.get('p2ptype', 1)
+                # 获取p2p类型
+                p2p_type = request_dict.get('p2ptype', None)
                 if serial_number[9:10]:
                     p2p_type = serial_number[9:10]
+                elif not p2p_type:
+                    return response.json(444, {'param': 'p2ptype'})
                 p2p_type = int(p2p_type)
 
                 with transaction.atomic():