|
@@ -487,9 +487,9 @@ class SerialNumberView(View):
|
|
|
"""
|
|
|
token = request_dict.get('token', None)
|
|
|
time_stamp = request_dict.get('time_stamp', None)
|
|
|
- company_secret = request_dict.get('company_id', None)
|
|
|
+ company_secret = request_dict.get('company_id', None) # 企业id, Ansjer: MTEyMTNB, Loocam: VmXEWnBR
|
|
|
|
|
|
- if not all([token, time_stamp, company_secret]):
|
|
|
+ if not all([token, time_stamp, company_secret]) or company_secret not in ['MTEyMTNB', 'VmXEWnBR']:
|
|
|
return response.json(444)
|
|
|
|
|
|
# 时间戳token校验
|
|
@@ -504,8 +504,13 @@ class SerialNumberView(View):
|
|
|
return response.json(5)
|
|
|
redis_obj.CONN.expire(serial_operate_lock_key, 60)
|
|
|
|
|
|
- # 查询13800138005账号(user_id: 6)下未使用的序列号
|
|
|
- user_serial_number_qs = UserSerialNumberModel.objects.filter(user__id=6, serial_number__use_status=1).first()
|
|
|
+ # 企业为Ansjer查询13800138005账号(user_id: 6)下未使用的序列号,Loocam查询13800138006账号(user_id: 7)
|
|
|
+ if company_secret == 'MTEyMTNB':
|
|
|
+ user_serial_number_qs = UserSerialNumberModel.objects.filter(user__id=6,
|
|
|
+ serial_number__use_status=1).first()
|
|
|
+ else:
|
|
|
+ user_serial_number_qs = UserSerialNumberModel.objects.filter(user__id=7,
|
|
|
+ serial_number__use_status=1).first()
|
|
|
if user_serial_number_qs is None:
|
|
|
redis_obj.del_data(key=serial_operate_lock_key) # redis解锁
|
|
|
return response.json(14)
|