Compare commits

..

2 Commits

Author SHA1 Message Date
e6c1599cb2 Merge branch 'master' of http://111.229.35.227:3000/gitadmin/wms-naivevue 2024-12-18 15:55:44 +08:00
ab50ef7786 上传 2024-12-18 15:55:19 +08:00
2 changed files with 6 additions and 6 deletions

View File

@ -83,13 +83,13 @@
/**
* 上传文件之前验证
*/
const beforeUpload = (file) => {
const isLt2M = file.size / 1024 / 1024 < 200;
const beforeUpload = (rawFile) => {
const isLt2M = rawFile.file.file.size / 1024 / 1024 < 200;
if (!isLt2M) {
message.warning('大小不能超过200MB!');
return false;
}
if (!/\.(xlsx|xls|XLSX|XLS)$/.test(file.name)) {
if (!/\.(xlsx|xls|XLSX|XLS)$/.test(rawFile.file.name)) {
message.warning('请上传.xlsx .xls');
return false;
}

View File

@ -84,13 +84,13 @@
/**
* 上传文件之前验证
*/
const beforeUpload = (file) => {
const isLt2M = file.size / 1024 / 1024 < 200;
const beforeUpload = (rawFile) => {
const isLt2M = rawFile.file.file.size / 1024 / 1024 < 200;
if (!isLt2M) {
message.warning('大小不能超过200MB!');
return false;
}
if (!/\.(xlsx|xls|XLSX|XLS)$/.test(file.name)) {
if (!/\.(xlsx|xls|XLSX|XLS)$/.test(rawFile.file.name)) {
message.warning('请上传.xlsx .xls');
return false;
}