|
@@ -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 () => {
|