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
| @@ -38,7 +38,7 @@ export const schemas: FormSchema[] = [ | @@ -38,7 +38,7 @@ export const schemas: FormSchema[] = [ | ||
| 38 | { | 38 | { |
| 39 | field: 'icon', | 39 | field: 'icon', |
| 40 | component: 'Upload', | 40 | component: 'Upload', |
| 41 | - label: '浏览器Icon图标', | 41 | + label: '浏览器ico图标', |
| 42 | colProps: { | 42 | colProps: { |
| 43 | span: 24, | 43 | span: 24, |
| 44 | }, | 44 | }, |
| @@ -149,16 +149,16 @@ | @@ -149,16 +149,16 @@ | ||
| 149 | } | 149 | } |
| 150 | } | 150 | } |
| 151 | const beforeUploadIconPic = (file: FileItem) => { | 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 | createMessage.error('只能上传.ico图片文件!'); | 154 | createMessage.error('只能上传.ico图片文件!'); |
| 155 | + return false; | ||
| 156 | } | 156 | } |
| 157 | const isLt2M = (file.size as number) / 1024 < 500; | 157 | const isLt2M = (file.size as number) / 1024 < 500; |
| 158 | if (!isLt2M) { | 158 | if (!isLt2M) { |
| 159 | createMessage.error('图片大小不能超过500KB!'); | 159 | createMessage.error('图片大小不能超过500KB!'); |
| 160 | } | 160 | } |
| 161 | - return isJpgOrPng && isLt2M; | 161 | + return isLt2M; |
| 162 | }; | 162 | }; |
| 163 | // 更新 | 163 | // 更新 |
| 164 | const handleUpdateInfo = async () => { | 164 | const handleUpdateInfo = async () => { |