Commit c428c7c6d6917c1cc1d2efc465c7012960051d4a

Authored by fengtao
1 parent eefa8163

fix:修改PC端所有上传图片限制为5M以下

@@ -155,9 +155,9 @@ @@ -155,9 +155,9 @@
155 if (!isJpgOrPng) { 155 if (!isJpgOrPng) {
156 createMessage.error('只能上传图片文件!'); 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 if (!isLt2M) { 159 if (!isLt2M) {
160 - createMessage.error('图片大小不能超过2MB!'); 160 + createMessage.error('图片大小不能超过5MB!');
161 } 161 }
162 return isJpgOrPng && isLt2M; 162 return isJpgOrPng && isLt2M;
163 }; 163 };
@@ -84,9 +84,9 @@ @@ -84,9 +84,9 @@
84 if (!isJpgOrPng) { 84 if (!isJpgOrPng) {
85 message.error('只能上传图片文件!'); 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 if (!isLt2M) { 88 if (!isLt2M) {
89 - message.error('图片大小不能超过2MB!'); 89 + message.error('图片大小不能超过5MB!');
90 } 90 }
91 return isJpgOrPng && isLt2M; 91 return isJpgOrPng && isLt2M;
92 }; 92 };
@@ -207,7 +207,9 @@ @@ -207,7 +207,9 @@
207 handleCancel(); 207 handleCancel();
208 }) 208 })
209 .catch((e) => { 209 .catch((e) => {
210 - createMessage.error(e); 210 + if (e?.message) {
  211 + createMessage.error(e?.message);
  212 + }
211 }); 213 });
212 }; 214 };
213 return { 215 return {
@@ -153,9 +153,9 @@ @@ -153,9 +153,9 @@
153 if (!isJpgOrPng) { 153 if (!isJpgOrPng) {
154 message.error('只能上传图片文件!'); 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 if (!isLt2M) { 157 if (!isLt2M) {
158 - message.error('图片大小不能超过2MB!'); 158 + message.error('图片大小不能超过5MB!');
159 } 159 }
160 return isJpgOrPng && isLt2M; 160 return isJpgOrPng && isLt2M;
161 }; 161 };
@@ -89,9 +89,9 @@ @@ -89,9 +89,9 @@
89 if (!isJpgOrPng) { 89 if (!isJpgOrPng) {
90 createMessage.error('只能上传图片文件!'); 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 if (!isLt2M) { 93 if (!isLt2M) {
94 - createMessage.error('图片大小不能超过2MB!'); 94 + createMessage.error('图片大小不能超过5MB!');
95 } 95 }
96 return isJpgOrPng && isLt2M; 96 return isJpgOrPng && isLt2M;
97 }; 97 };
@@ -187,9 +187,9 @@ @@ -187,9 +187,9 @@
187 if (!isJpgOrPng) { 187 if (!isJpgOrPng) {
188 createMessage.error('只能上传图片文件!'); 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 if (!isLt2M) { 191 if (!isLt2M) {
192 - createMessage.error('图片大小不能超过2MB!'); 192 + createMessage.error('图片大小不能超过5MB!');
193 } 193 }
194 return isJpgOrPng && isLt2M; 194 return isJpgOrPng && isLt2M;
195 }; 195 };
@@ -221,9 +221,9 @@ @@ -221,9 +221,9 @@
221 if (!isJpgOrPng) { 221 if (!isJpgOrPng) {
222 createMessage.error('只能上传图片文件!'); 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 if (!isLt2M) { 225 if (!isLt2M) {
226 - createMessage.error('图片大小不能超过2MB!'); 226 + createMessage.error('图片大小不能超过5MB!');
227 } 227 }
228 return isJpgOrPng && isLt2M; 228 return isJpgOrPng && isLt2M;
229 }; 229 };
@@ -190,9 +190,9 @@ @@ -190,9 +190,9 @@
190 if (!isJpgOrPng) { 190 if (!isJpgOrPng) {
191 createMessage.error('只能上传图片文件!'); 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 if (!isLt2M) { 194 if (!isLt2M) {
195 - createMessage.error('图片大小不能超过2MB!'); 195 + createMessage.error('图片大小不能超过5MB!');
196 } 196 }
197 return isJpgOrPng && isLt2M; 197 return isJpgOrPng && isLt2M;
198 }; 198 };
@@ -106,9 +106,9 @@ @@ -106,9 +106,9 @@
106 if (!isJpgOrPng) { 106 if (!isJpgOrPng) {
107 createMessage.error('只能上传图片文件!'); 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 if (!isLt2M) { 110 if (!isLt2M) {
111 - createMessage.error('图片大小不能超过2MB!'); 111 + createMessage.error('图片大小不能超过5MB!');
112 } 112 }
113 return isJpgOrPng && isLt2M; 113 return isJpgOrPng && isLt2M;
114 }; 114 };
@@ -69,9 +69,9 @@ @@ -69,9 +69,9 @@
69 if (!isJpgOrPng) { 69 if (!isJpgOrPng) {
70 message.error('只能上传图片文件!'); 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 if (!isLt2M) { 73 if (!isLt2M) {
74 - message.error('图片大小不能超过2MB!'); 74 + message.error('图片大小不能超过5MB!');
75 } 75 }
76 return isJpgOrPng && isLt2M; 76 return isJpgOrPng && isLt2M;
77 }; 77 };