fix: 上传文档大小扩大到100MB

This commit is contained in:
shaohuzhang1 2024-04-09 15:21:40 +08:00
parent 5e200b2cec
commit b038f12a52
3 changed files with 9 additions and 9 deletions

View File

@ -24,12 +24,12 @@ default_pattern_list = [re.compile('(?<=^)# .*|(?<=\\n)# .*'), re.compile('(?<!#
class DocSplitHandle(BaseSplitHandle): class DocSplitHandle(BaseSplitHandle):
@staticmethod @staticmethod
def paragraph_to_md(paragraph): def paragraph_to_md(paragraph):
psn = paragraph.style.name try:
if psn.startswith('Heading'): psn = paragraph.style.name
try: if psn.startswith('Heading'):
return "".join(["#" for i in range(int(psn.replace("Heading ", '')))]) + " " + paragraph.text return "".join(["#" for i in range(int(psn.replace("Heading ", '')))]) + " " + paragraph.text
except Exception as e: except Exception as e:
return paragraph.text return paragraph.text
return paragraph.text return paragraph.text
def to_md(self, doc): def to_md(self, doc):

View File

@ -470,8 +470,8 @@ class DocumentSerializers(ApiMixin, serializers.Serializer):
super().is_valid(raise_exception=True) super().is_valid(raise_exception=True)
files = self.data.get('file') files = self.data.get('file')
for f in files: for f in files:
if f.size > 1024 * 1024 * 10: if f.size > 1024 * 1024 * 100:
raise AppApiException(500, "上传文件最大不能超过10m") raise AppApiException(500, "上传文件最大不能超过100MB")
@staticmethod @staticmethod
def get_request_params_api(): def get_request_params_api():

View File

@ -85,9 +85,9 @@ function deleteFlie(index: number) {
// on-change // on-change
const filehandleChange = (file: any, fileList: UploadFiles) => { const filehandleChange = (file: any, fileList: UploadFiles) => {
//110M //110M
const isLimit = file?.size / 1024 / 1024 < 10 const isLimit = file?.size / 1024 / 1024 < 100
if (!isLimit) { if (!isLimit) {
MsgError('文件大小超过 10MB') MsgError('文件大小超过 100MB')
fileList.splice(-1, 1) // fileList.splice(-1, 1) //
return false return false
} }