|
@@ -46,6 +46,7 @@
|
|
|
</a-upload>
|
|
|
<p style="margin: 0;">1、请保证脸部无遮挡、光线充足</p>
|
|
|
<p style="margin: 0;">2、视频、照片中只能出现一张人脸</p>
|
|
|
+ <p style="margin: 0;">3、图片尺寸不能小于500*500</p>
|
|
|
</a-form-model-item>
|
|
|
</a-form-model>
|
|
|
<div v-else-if="faceType === 'b'" class="face-right-div">
|
|
@@ -204,7 +205,6 @@ export default {
|
|
|
this.dataAllList = [];
|
|
|
this.dataSource = [];
|
|
|
this.totalAll = 0;
|
|
|
- this.$message.error(result.message);
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
console.log(error, 'eeee');
|
|
@@ -321,7 +321,7 @@ export default {
|
|
|
if (result.code === 0) {
|
|
|
this.handlePolicyOperationCancel();
|
|
|
this.$emit('sureface');
|
|
|
- this.$message.success('图片上传成功');
|
|
|
+ this.$message.success('图片上传成功');l
|
|
|
this.confirmLoading = false;
|
|
|
}
|
|
|
else {
|
|
@@ -332,7 +332,6 @@ export default {
|
|
|
this.confirmLoading = false;
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
- console.log(error, 'eeee');
|
|
|
this.confirmLoading = false;
|
|
|
});
|
|
|
}
|
|
@@ -363,10 +362,28 @@ export default {
|
|
|
this.md5Result = '';
|
|
|
return;
|
|
|
}
|
|
|
- this.handleMd5(info);
|
|
|
- this.cosUpload(info);
|
|
|
- this.getBase64(info, imageUrl => {
|
|
|
- this.imageUrl = imageUrl;
|
|
|
+ new Promise(function (resolve, reject) {
|
|
|
+ let width = 500;
|
|
|
+ let height = 500;
|
|
|
+ let _URL = window.URL || window.webkitURL;
|
|
|
+ let img = new Image();
|
|
|
+ img.onload = function () {
|
|
|
+ let valid = img.width >= width && img.height >= height;
|
|
|
+ valid ? resolve() : reject();
|
|
|
+ };
|
|
|
+ img.src = _URL.createObjectURL(info);
|
|
|
+ }).then(() => {
|
|
|
+ this.handleMd5(info);
|
|
|
+ this.cosUpload(info);
|
|
|
+ this.getBase64(info, imageUrl => {
|
|
|
+ this.imageUrl = imageUrl;
|
|
|
+ });
|
|
|
+ }, () => {
|
|
|
+ this.$message.error('图片尺寸不能小于500*500');
|
|
|
+ this.imageUrl = '';
|
|
|
+ this.urlResult = '';
|
|
|
+ this.md5Result = '';
|
|
|
+ return Promise.reject();
|
|
|
});
|
|
|
},
|
|
|
handleMd5(file) {
|