|
@@ -87,7 +87,10 @@ class PcInfo(View):
|
|
file_path = 'static/pc/' + pc_name
|
|
file_path = 'static/pc/' + pc_name
|
|
if not os.path.exists(file_path):
|
|
if not os.path.exists(file_path):
|
|
os.makedirs(os.path.join(BASE_DIR, file_path))
|
|
os.makedirs(os.path.join(BASE_DIR, file_path))
|
|
- name = pc_version + '_' + bundle_version + '_' + pc_test + '_' + str(file_name)
|
|
|
|
|
|
+ a = os.path.splitext(str(file_name))[-1]
|
|
|
|
+ if not a:
|
|
|
|
+ return response.json(444, "文件无后缀")
|
|
|
|
+ name = pc_version + '_' + bundle_version + '_' + pc_test + str(a)
|
|
file_path = file_path + '/' + str(name)
|
|
file_path = file_path + '/' + str(name)
|
|
upload_path = os.path.join(BASE_DIR, file_path)
|
|
upload_path = os.path.join(BASE_DIR, file_path)
|
|
print('upload_path:', upload_path)
|
|
print('upload_path:', upload_path)
|
|
@@ -110,7 +113,7 @@ class PcInfo(View):
|
|
except Exception:
|
|
except Exception:
|
|
errorInfo = traceback.format_exc()
|
|
errorInfo = traceback.format_exc()
|
|
print(errorInfo)
|
|
print(errorInfo)
|
|
- return response.json(500, {'details': errorInfo})
|
|
|
|
|
|
+ return response.json(700, {'details': errorInfo})
|
|
else:
|
|
else:
|
|
if pc_Info.id:
|
|
if pc_Info.id:
|
|
res = {'pc_name': pc_Info.pc_name,
|
|
res = {'pc_name': pc_Info.pc_name,
|