From 0f518ef6cbf9f94e1f5e2ae3e97c02e743e0ac80 Mon Sep 17 00:00:00 2001 From: zh <972939975@qq.com> Date: Fri, 22 Aug 2025 10:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=AE=BE=E7=BD=AE=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Obj/Element/richText.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Obj/Element/richText.js b/src/Obj/Element/richText.js index 072a599..c63614c 100644 --- a/src/Obj/Element/richText.js +++ b/src/Obj/Element/richText.js @@ -56,8 +56,8 @@ class richText { MENU_CONF: { uploadImage: { fieldName: 'file', - maxFileSize: 50 * 1024 * 1024, - base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64 + // maxFileSize: 50 * 1024 * 1024, + // base64LimitSize: 50 * 1024 * 1024, // 50M 以下插入 base64 server: this.uploadImageServer, // // 上传之前触发 // onBeforeUpload(file) { // TS 语法 @@ -95,18 +95,18 @@ class richText { // console.log(`${file.name} 上传出错`, err, res) // }, - // // 自定义上传 - // async customUpload(file, insertFn) { // TS 语法 - // // async customUpload(file, insertFn) { // JS 语法 - // // file 即选中的文件 - // // 自己实现上传,并得到图片 url alt href - // // 最后插入图片 - // console.log(file, insertFn) - // insertFn(url, file.name) - // } + // 自定义上传 + async customUpload(file, insertFn) { // TS 语法 + // async customUpload(file, insertFn) { // JS 语法 + // file 即选中的文件 + // 自己实现上传,并得到图片 url alt href + // 最后插入图片 + let url = await _this.upload(file) + insertFn((_this.host = _this.host || getHost()) + '/' + url) + } }, uploadVideo: { - maxFileSize: 500 * 1024 * 1024, + // maxFileSize: 500 * 1024 * 1024, server: this.uploadVideoServer, allowedFileTypes: ['video/mp4', 'video/mp3', 'video/ogg', 'video/webm', 'video/avi'], // 自定义上传