Commit 27a7730bc6aa40c6dcda4a7b3420ca94f615faa2
Merge branch 'main_dev' of http://git.yunteng.com/yunteng/thingskit-front into fix/DEFECT-1362
Showing
2 changed files
with
5 additions
and
5 deletions
| ... | ... | @@ -149,16 +149,16 @@ |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | const beforeUploadIconPic = (file: FileItem) => { |
| 152 | - console.log(file); | |
| 153 | - const isJpgOrPng = file.type === 'image/vnd.microsoft.icon'; | |
| 154 | - if (!isJpgOrPng) { | |
| 152 | + const reg = /.(icon|ico)$/i; | |
| 153 | + if (!reg.test(file.name)) { | |
| 155 | 154 | createMessage.error('只能上传.ico图片文件!'); |
| 155 | + return false; | |
| 156 | 156 | } |
| 157 | 157 | const isLt2M = (file.size as number) / 1024 < 500; |
| 158 | 158 | if (!isLt2M) { |
| 159 | 159 | createMessage.error('图片大小不能超过500KB!'); |
| 160 | 160 | } |
| 161 | - return isJpgOrPng && isLt2M; | |
| 161 | + return isLt2M; | |
| 162 | 162 | }; |
| 163 | 163 | // 更新 |
| 164 | 164 | const handleUpdateInfo = async () => { | ... | ... |