locky 2 жил өмнө
parent
commit
bbbc271481

+ 4 - 1
Controller/SerialNumberController.py

@@ -134,9 +134,12 @@ class SerialNumberView(View):
                 if region_id not in REGION_ID_LIST:
                 if region_id not in REGION_ID_LIST:
                     return response.json(444, {'invalid region_id': region_id})
                     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]:
                 if serial_number[9:10]:
                     p2p_type = 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)
                 p2p_type = int(p2p_type)
 
 
                 with transaction.atomic():
                 with transaction.atomic():