task#,身份证上传添加验证
This commit is contained in:
@ -217,6 +217,12 @@ export default {
|
|||||||
this.states=e
|
this.states=e
|
||||||
},
|
},
|
||||||
async identityCardFrontHandler(file) { // 上传身份证正面照片
|
async identityCardFrontHandler(file) { // 上传身份证正面照片
|
||||||
|
console.log("file",file)
|
||||||
|
// 检查文件大小
|
||||||
|
if (file.file.size > 5 * 1024 * 1024) {
|
||||||
|
this.$toast('文件大小不能超过 5MB');
|
||||||
|
// return;
|
||||||
|
}
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file" , file.file);
|
formData.append("file" , file.file);
|
||||||
let res = await uploadImage(formData)
|
let res = await uploadImage(formData)
|
||||||
|
Reference in New Issue
Block a user