|
@@ -209,6 +209,12 @@ def do_upload_uid(request):
|
|
|
return response.json(444)
|
|
|
file = request.FILES.get('file', None)
|
|
|
vpg_id = request_dict.get('vpg_id', None)
|
|
|
+ platform = request_dict.get('platform', None)
|
|
|
+ init_string = request_dict.get('init_string', None)
|
|
|
+ init_string_app = request_dict.get('init_string_app', None)
|
|
|
+
|
|
|
+ if not all([vpg_id, platform, init_string, init_string_app]):
|
|
|
+ return response.json(444)
|
|
|
|
|
|
bulk = []
|
|
|
add_time = update_time = int(time.time())
|
|
@@ -217,9 +223,7 @@ def do_upload_uid(request):
|
|
|
if (not MAC['is_active']) or (current_mac[-8:] == 'FF.FF.FF'):
|
|
|
return response.json(175)
|
|
|
|
|
|
- area = 0
|
|
|
- if vpg_id != 1:
|
|
|
- area = 1
|
|
|
+ area = 1 if vpg_id != '1' else 0
|
|
|
# path = '/'.join((BASE_DIR, 'static/uid')).replace('\\', '/') + '/'
|
|
|
# if not os.path.exists(path):
|
|
|
# os.makedirs(path)
|
|
@@ -242,6 +246,9 @@ def do_upload_uid(request):
|
|
|
update_time=update_time,
|
|
|
area=area, # 关联vgp表已有区域信息,可以考虑去掉
|
|
|
vpg_id=vpg_id,
|
|
|
+ platform=platform,
|
|
|
+ init_string=init_string,
|
|
|
+ init_string_app=init_string_app
|
|
|
)
|
|
|
if len(uid) == 14: # 宸云
|
|
|
UID.p2p_type = 1
|