Commit 2f7d842bd350dc9312d4825f7d7ffd205126c699
Merge branch 'ft-dev' into 'main'
fix:修改PC端所有上传图片限制为5M以下 See merge request huang/yun-teng-iot-front!218
Showing
9 changed files
with
21 additions
and
19 deletions
| ... | ... | @@ -155,9 +155,9 @@ |
| 155 | 155 | if (!isJpgOrPng) { |
| 156 | 156 | createMessage.error('只能上传图片文件!'); |
| 157 | 157 | } |
| 158 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 158 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 159 | 159 | if (!isLt2M) { |
| 160 | - createMessage.error('图片大小不能超过2MB!'); | |
| 160 | + createMessage.error('图片大小不能超过5MB!'); | |
| 161 | 161 | } |
| 162 | 162 | return isJpgOrPng && isLt2M; |
| 163 | 163 | }; | ... | ... |
| ... | ... | @@ -84,9 +84,9 @@ |
| 84 | 84 | if (!isJpgOrPng) { |
| 85 | 85 | message.error('只能上传图片文件!'); |
| 86 | 86 | } |
| 87 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 87 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 88 | 88 | if (!isLt2M) { |
| 89 | - message.error('图片大小不能超过2MB!'); | |
| 89 | + message.error('图片大小不能超过5MB!'); | |
| 90 | 90 | } |
| 91 | 91 | return isJpgOrPng && isLt2M; |
| 92 | 92 | }; | ... | ... |
| ... | ... | @@ -153,9 +153,9 @@ |
| 153 | 153 | if (!isJpgOrPng) { |
| 154 | 154 | message.error('只能上传图片文件!'); |
| 155 | 155 | } |
| 156 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 156 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 157 | 157 | if (!isLt2M) { |
| 158 | - message.error('图片大小不能超过2MB!'); | |
| 158 | + message.error('图片大小不能超过5MB!'); | |
| 159 | 159 | } |
| 160 | 160 | return isJpgOrPng && isLt2M; |
| 161 | 161 | }; | ... | ... |
| ... | ... | @@ -89,9 +89,9 @@ |
| 89 | 89 | if (!isJpgOrPng) { |
| 90 | 90 | createMessage.error('只能上传图片文件!'); |
| 91 | 91 | } |
| 92 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 92 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 93 | 93 | if (!isLt2M) { |
| 94 | - createMessage.error('图片大小不能超过2MB!'); | |
| 94 | + createMessage.error('图片大小不能超过5MB!'); | |
| 95 | 95 | } |
| 96 | 96 | return isJpgOrPng && isLt2M; |
| 97 | 97 | }; | ... | ... |
| ... | ... | @@ -187,9 +187,9 @@ |
| 187 | 187 | if (!isJpgOrPng) { |
| 188 | 188 | createMessage.error('只能上传图片文件!'); |
| 189 | 189 | } |
| 190 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 190 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 191 | 191 | if (!isLt2M) { |
| 192 | - createMessage.error('图片大小不能超过2MB!'); | |
| 192 | + createMessage.error('图片大小不能超过5MB!'); | |
| 193 | 193 | } |
| 194 | 194 | return isJpgOrPng && isLt2M; |
| 195 | 195 | }; |
| ... | ... | @@ -221,9 +221,9 @@ |
| 221 | 221 | if (!isJpgOrPng) { |
| 222 | 222 | createMessage.error('只能上传图片文件!'); |
| 223 | 223 | } |
| 224 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 224 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 225 | 225 | if (!isLt2M) { |
| 226 | - createMessage.error('图片大小不能超过2MB!'); | |
| 226 | + createMessage.error('图片大小不能超过5MB!'); | |
| 227 | 227 | } |
| 228 | 228 | return isJpgOrPng && isLt2M; |
| 229 | 229 | }; | ... | ... |
| ... | ... | @@ -190,9 +190,9 @@ |
| 190 | 190 | if (!isJpgOrPng) { |
| 191 | 191 | createMessage.error('只能上传图片文件!'); |
| 192 | 192 | } |
| 193 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 193 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 194 | 194 | if (!isLt2M) { |
| 195 | - createMessage.error('图片大小不能超过2MB!'); | |
| 195 | + createMessage.error('图片大小不能超过5MB!'); | |
| 196 | 196 | } |
| 197 | 197 | return isJpgOrPng && isLt2M; |
| 198 | 198 | }; | ... | ... |
| ... | ... | @@ -106,9 +106,9 @@ |
| 106 | 106 | if (!isJpgOrPng) { |
| 107 | 107 | createMessage.error('只能上传图片文件!'); |
| 108 | 108 | } |
| 109 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 109 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 110 | 110 | if (!isLt2M) { |
| 111 | - createMessage.error('图片大小不能超过2MB!'); | |
| 111 | + createMessage.error('图片大小不能超过5MB!'); | |
| 112 | 112 | } |
| 113 | 113 | return isJpgOrPng && isLt2M; |
| 114 | 114 | }; | ... | ... |
| ... | ... | @@ -69,9 +69,9 @@ |
| 69 | 69 | if (!isJpgOrPng) { |
| 70 | 70 | message.error('只能上传图片文件!'); |
| 71 | 71 | } |
| 72 | - const isLt2M = (file.size as number) / 1024 / 1024 < 2; | |
| 72 | + const isLt2M = (file.size as number) / 1024 / 1024 < 5; | |
| 73 | 73 | if (!isLt2M) { |
| 74 | - message.error('图片大小不能超过2MB!'); | |
| 74 | + message.error('图片大小不能超过5MB!'); | |
| 75 | 75 | } |
| 76 | 76 | return isJpgOrPng && isLt2M; |
| 77 | 77 | }; | ... | ... |