diff --git a/apps/system/views.py b/apps/system/views.py index ac40d750..7dc89a45 100755 --- a/apps/system/views.py +++ b/apps/system/views.py @@ -633,11 +633,6 @@ class FileViewSet(CustomCreateModelMixin, RetrieveModelMixin, ListModelMixin, Cu instance.save() -# 生成ConfigParser对象 -config = configparser.ConfigParser() -# 读取配置文件 -filename = os.path.join(settings.BASE_DIR, 'server/conf.ini') - class ApkViewSet(MyLoggingMixin, ListModelMixin, CreateModelMixin, GenericViewSet): perms_map = {'get': '*', 'post': 'apk.upload'} serializer_class = ApkSerializer @@ -671,6 +666,7 @@ class ApkViewSet(MyLoggingMixin, ListModelMixin, CreateModelMixin, GenericViewSe vdata = sr.validated_data from shutil import copyfile copyfile(settings.BASE_DIR + vdata['file'], settings.BASE_DIR + '/media/zc_ehs.apk') + global SYSCONF SYSCONF['apk']['apk_version'] = vdata['version'] SYSCONF['apk']['apk_file'] = vdata['file'] SysConfigView.save_sysconf()