功能变化: import_export 导入bug优化

pull/57/head
李强 2022-05-13 22:42:01 +08:00
parent 03f51f3706
commit d4602e41ae
1 changed files with 1 additions and 2 deletions

View File

@ -15,8 +15,7 @@ def import_to_data(file_url, field_data):
:return:
"""
# 读取excel 文件
file_path = os.path.join(settings.MEDIA_ROOT, file_url)
file_path_dir = os.path.join(settings.BASE_DIR, file_path)
file_path_dir = os.path.join(settings.BASE_DIR, file_url)
workbook = openpyxl.load_workbook(file_path_dir)
table = workbook[workbook.sheetnames[0]]
# 创建一个空列表存储Excel的数据