Browse Source

视频文件最大上传大小改为2g,上传最长时长改为4mins

danch 10 months ago
parent
commit
56101b0725
2 changed files with 7 additions and 7 deletions
  1. 1 1
      src/api/common/api.ts
  2. 6 6
      src/components/Tinymce/src/Editor.vue

+ 1 - 1
src/api/common/api.ts

@@ -96,7 +96,7 @@ export const loadCategoryData = (params) => {
  * 文件上传
  */
 export const uploadFile = (params, success) => {
-  return defHttp.uploadFile({url: uploadUrl, timeout: 2 * 60 * 1000}, params, {success});
+  return defHttp.uploadFile({url: uploadUrl, timeout: 4 * 60 * 1000}, params, {success});
 };
 /**
  * 下载文件

+ 6 - 6
src/components/Tinymce/src/Editor.vue

@@ -231,8 +231,8 @@ export default defineComponent({
             input.onchange = async function () {
               const file = this.files[0] // 为 HTMLInputElement 构造函数中的 this,指向 input 实例对象
               fileName = file.name
-              if (file.size / 1024 / 1024 > 1024) {
-                message.error("文件大小超过1G,请压缩或降低质量")
+              if (file.size / 1024 / 1024 > 2048) {
+                message.error("文件大小超过2G,请压缩或降低质量")
                 spinning.value = false;
                 tox.style.zIndex = 2;
                 return
@@ -263,10 +263,10 @@ export default defineComponent({
             input.onchange = async function () {
               const file = this.files[0] // 为 HTMLInputElement 构造函数中的 this,指向 input 实例对象
               fileName = file.name
-              if (file.size / 1024 / 1024 > 1024) {
+              if (file.size / 1024 / 1024 > 2048) {
                 spinning.value = false;
                 tox.style.zIndex = 2;
-                message.error("视频大小超过1G,请压缩或降低质量")
+                message.error("视频大小超过2G,请压缩或降低质量")
                 return
               }
               let params = {
@@ -293,8 +293,8 @@ export default defineComponent({
             input.onchange = async function () {
               const file = this.files[0] // 为 HTMLInputElement 构造函数中的 this,指向 input 实例对象
               fileName = file.name
-              if (file.size / 1024 / 1024 > 1024) {
-                message.error("图片大小超过1G,请压缩或降低质量")
+              if (file.size / 1024 / 1024 > 100) {
+                message.error("图片大小超过100MB,请压缩或降低质量")
                 spinning.value = false;
                 tox.style.zIndex = 2;
                 return