fix: 上传文档大小扩大到100MB
This commit is contained in:
parent
5e200b2cec
commit
b038f12a52
@ -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):
|
||||||
|
|||||||
@ -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():
|
||||||
|
|||||||
@ -85,9 +85,9 @@ function deleteFlie(index: number) {
|
|||||||
// 上传on-change事件
|
// 上传on-change事件
|
||||||
const filehandleChange = (file: any, fileList: UploadFiles) => {
|
const filehandleChange = (file: any, fileList: UploadFiles) => {
|
||||||
//1、判断文件大小是否合法,文件限制不能大于10M
|
//1、判断文件大小是否合法,文件限制不能大于10M
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user