Ver código fonte

1、修改图片上传大小上限

billisme 3 anos atrás
pai
commit
8195efa80f

+ 1 - 1
.env.production

@@ -9,4 +9,4 @@ VUE_APP_IM_API = 'https://lymall-im.58for.com'
 VUE_APP_WS_IM_API = 'wss://lymall-im.58for.com'
 
 # 静态资源文件url
-VUE_APP_RESOURCES_URL = 'http://lymall-minio.58for.com/mall4j/'
+VUE_APP_RESOURCES_URL = 'https://ecard-oss.58for.com/'

+ 4 - 4
src/components/elx-imgbox/index.vue

@@ -188,7 +188,7 @@ export default {
   name: 'ElxImgbox',
   props: {
     maxSize: {
-      default: 2,
+      default: 10,
       type: Number
     },
     imgSizeLimit: {
@@ -208,7 +208,7 @@ export default {
       options: {
         multiple: true, // 是否支持选取多个图片
         limit: 20, // 最多可选择图片数量
-        maxSize: 2, // 最大尺寸(M)
+        maxSize: 10, // 最大尺寸(M)
         activeTab: 'pick',
         enableUpload: true, // 是否启用图片上传
         callback: null
@@ -564,7 +564,7 @@ export default {
         this.errMsg()
         return false
       }
-      const isSize = file.size / (1024 * 1024) < 2
+      const isSize = file.size / (1024 * 1024) < 10
       if (!isSize) {
         this.errShow = true
         this.errMsg()
@@ -588,7 +588,7 @@ export default {
     },
 
     uploadSizeTip () {
-      return this.$i18n.t('pictureManager.notExceed') + '2M'
+      return this.$i18n.t('pictureManager.notExceed') + '10M'
     },
 
     uploadTips () {

+ 2 - 2
src/components/file-upload/index.vue

@@ -50,9 +50,9 @@ export default {
     },
     // 限制图片上传大小
     beforeAvatarUpload (file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
+      const isLt2M = file.size / 1024 / 1024 < 10
       if (!isLt2M) {
-        this.$message.error('上传头像图片大小不能超过 2MB!')
+        this.$message.error('上传头像图片大小不能超过 10MB!')
       }
       return isLt2M
     },

+ 2 - 2
src/components/mul-pic-upload/index.vue

@@ -105,9 +105,9 @@ export default {
     },
     // 限制图片上传大小
     beforeAvatarUpload (file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
+      const isLt2M = file.size / 1024 / 1024 < 10
       if (!isLt2M) {
-        this.$message.error('上传图片大小不能超过 2MB!')
+        this.$message.error('上传图片大小不能超过 10MB!')
       }
       return isLt2M
     },

+ 2 - 2
src/components/pic-upload/index.vue

@@ -44,9 +44,9 @@ export default {
     },
     // 限制图片上传大小
     beforeAvatarUpload (file) {
-      const isLt2M = file.size / 1024 / 1024 < 2
+      const isLt2M = file.size / 1024 / 1024 < 10
       if (!isLt2M) {
-        this.$message.error('上传图片大小不能超过 2MB!')
+        this.$message.error('上传图片大小不能超过 10MB!')
       }
       return isLt2M
     },

+ 2 - 2
src/i18n/langs/zh_CN.js

@@ -474,7 +474,7 @@ const zhCn = {
     revName: '修改名称',
     inputNewName: '请输入新的图片名称',
     superiorLimit: '可选择照片数量已达上限',
-    onlyPictures: '只支持图片格式、大小不能超过2m,其他文件已清除',
+    onlyPictures: '只支持图片格式、大小不能超过10m,其他文件已清除',
     onlySupported: '仅支持',
     pic: '图片',
     imageSize: '图片尺寸为',
@@ -1449,7 +1449,7 @@ const zhCn = {
     sizeCannotExceed: '大小不能超过',
     imageExc300Px: '图片宽度或高度不能超过300px',
     numHasReaLimit: '可选择照片数量已达上限',
-    onlyUploadPictures: '只支持图片格式、大小不能超过2m,其他文件已清除',
+    onlyUploadPictures: '只支持图片格式、大小不能超过10,其他文件已清除',
     onlySupportsPictures: '仅支持 jpg/png/gif 图片',
     theSizeCannotExceed2M: '大小不能超过2M',
     already: '已有',

+ 3 - 3
src/views/modules/resource/picture-store/upload-pic.vue

@@ -84,7 +84,7 @@ export default {
       options: {
         multiple: true, // 是否支持选取多个图片
         limit: 20, // 最多可选择图片数量
-        maxSize: 2, // 最大尺寸(M)
+        maxSize: 10, // 最大尺寸(M)
         enableUpload: true, // 是否启用图片上传
         callback: null
       },
@@ -280,7 +280,7 @@ export default {
         this.errMsg()
         return false
       }
-      const isSize = file.size / (1024 * 1024) < 2
+      const isSize = file.size / (1024 * 1024) < 10
       if (!isSize) {
         this.errShow = true
         this.errMsg()
@@ -304,7 +304,7 @@ export default {
     },
 
     uploadSizeTip () {
-      return this.$i18n.t('pictureManager.notExceed') + '2M'
+      return this.$i18n.t('pictureManager.notExceed') + '10M'
     },
 
     uploadTips () {