diff --git a/apps/hrm/views.py b/apps/hrm/views.py index 7bd5afc8..e59ae130 100755 --- a/apps/hrm/views.py +++ b/apps/hrm/views.py @@ -315,9 +315,8 @@ class EmployeeViewSet(CustomModelViewSet): myLogger = logging.getLogger('log') """导入excel""" file_path = request.data.get('file_path') - # if file_path: - # file_path = r"C:\Users\11825\Desktop\0303光芯花名册.xlsx" - abs_path = os.path.join(settings.BASE_DIR, file_path) + relative_path = file_path.lstrip('/') + abs_path = os.path.join(settings.BASE_DIR, relative_path) wb = load_workbook(abs_path, data_only=True) sheet = wb.active