task#,身份证上传添加验证

This commit is contained in:
2024-09-14 11:26:22 +08:00
parent 5fc76a5765
commit 4250119cce

View File

@ -217,6 +217,12 @@ export default {
this.states=e
},
async identityCardFrontHandler(file) { // 上传身份证正面照片
console.log("file",file)
// 检查文件大小
if (file.file.size > 5 * 1024 * 1024) {
this.$toast('文件大小不能超过 5MB');
// return;
}
const formData = new FormData();
formData.append("file" , file.file);
let res = await uploadImage(formData)