|
@@ -34,6 +34,7 @@ from Ansjer.config import (
|
|
SERVER_DOMAIN_SSL,
|
|
SERVER_DOMAIN_SSL,
|
|
SERVER_TYPE,
|
|
SERVER_TYPE,
|
|
CONFIG_TEST,
|
|
CONFIG_TEST,
|
|
|
|
+ BASE_DIR
|
|
)
|
|
)
|
|
from Model.models import (
|
|
from Model.models import (
|
|
CompanySerialModel,
|
|
CompanySerialModel,
|
|
@@ -1207,7 +1208,9 @@ class testView(View):
|
|
return response.json(444)
|
|
return response.json(444)
|
|
try:
|
|
try:
|
|
data = json.loads(data)
|
|
data = json.loads(data)
|
|
- LOGGER.info('设备上传数据:{}'.format(data))
|
|
|
|
|
|
+ file = '{}/static/generic_report_push.txt'.format(BASE_DIR)
|
|
|
|
+ with open(file, 'w', encoding='utf-8') as f:
|
|
|
|
+ json.dump(data, f, indent='\t', ensure_ascii=False)
|
|
return response.json(0)
|
|
return response.json(0)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|